
-----------------------------------
Deep613
Thu Jul 03, 2014 10:30 am

Mario Help Needed!!
-----------------------------------
This is my Mario game. There are so many bugs in the game. Coins do not disappear, mario is unable to find contact, as my screen is moving, I am unable to use any other moving object . Any help will be appreciated.

Thanks!


Turing version: 4.1

-----------------------------------
Insectoid
Thu Jul 03, 2014 11:28 am

RE:Mario Help Needed!!
-----------------------------------
Copy & paste the code onto here and I'll have a look. You might want to be more descriptive of your issues though- it sounds like these aren't bugs so much as you just haven't written the code yet.

-----------------------------------
Deep613
Thu Jul 03, 2014 11:38 am

Re: Mario Help Needed!!
-----------------------------------
My game is not going to work because there are pictures in my game and thus, it will work when pictures will be available. Still, I will copy and paste my code here.


% set the screen to various specific graphics
setscreen ("position:top, center, graphics: 1300, 700,title: Mario, nobuttonbar")

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                            variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Variable for the control of keys
var chars : array char of boolean

%Variables for the starting of the game
var firstScreen : int := Pic.FileNew ("Menu.bmp")
var controls : int := Pic.FileNew ("controls.bmp")
var thirdScreen : int := Pic.FileNew ("life3.bmp")
var mygame : int := Pic.FileNew ("mygame.jpg")

%Variable for the game over
var gameOver : int := Pic.FileNew ("gameover.bmp")

%variable for the background of the game
var previous_background : int := Pic.FileNew ("bg1.jpg")
var background : int := Pic.FileNew ("bg.jpg")


%Variable for the coins
var coin_touch : int := 0
var coin_cover : int := 0
var coin_count : int := 0
var coin_show : string

%variables for the Mario

var numFrames1 := Pic.FileNew ("marior.gif")
var numFrames2 := Pic.FileNew ("mariol.gif")
var numFrames3 := Pic.FileNew ("mariour.gif")
var numFrames4 := Pic.FileNew ("marioul.gif")
var game_over := Pic.FileNew ("gameover.bmp")
var sprite := Pic.FileNew ("mariol.gif")
const GROUND_HEIGHT := 78
const RUN_SPEED := 10
const JUMP_SPEED := 33
var GRAVITY := 2

var posx : int := 20
var posy : int := 0
var velx : real := 0
var vely : real := 0

%variables for various other things
var screen_capture : int

%Variables for the screen
var background_x : int := 0
var background_y : int := 0
var moving_speed : int
var framerate : int := 0

%Variables for the movement of screen
const MARGIN : int := 600
var key_count : int := 0

%Variables for other thingd on screen
var fall_down : int := 0
var jump_var : int := 0
var jump_over_tiles := 0
var tile1_y : int
var score : int := 0
var time_var : int := 5200

%Variable for the score menu
var score_menu := Pic.FileNew ("score.bmp")
%variable for the font and the set up the font
var font : int
font := Font.New ("Stencil Std:35:Bold")
var showscore : string
var showtime : string

%Variables for the end of the game
var end_var : int


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Start actual game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSTARTING SCREENS OF THE GAMEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


%Draw first screen of the game
Pic.Draw (firstScreen, 0, 0, picMerge)
%Start a loop
loop
    %Wait for an input from the user
    Input.KeyDown (chars)
    %If user press 'ENTER' exit loop
    if chars (KEY_ENTER) then
        exit
    end if
end loop
%claer screen
cls
%Draw secong screen of the game
Pic.Draw (mygame, 0, 0, picMerge)
delay (500)
%Start a loop
loop
    %Clear the screen
    Input.KeyDown (chars)
    if chars (KEY_ENTER) then
        exit
    end if
end loop

%Clear the screen
cls
%Draw third screen of the game
Pic.Draw (controls, 0, 0, picMerge)

%Put a delay of half a second in order for input to work
delay (500)

loop

    %Wait for an input from the user
    Input.KeyDown (chars)
    %If user press 'ENTER' exit loop
    if chars (KEY_ENTER) then
        exit
    end if
end loop
cls

%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXACTUAL GAMEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

setscreen ("offscreenonly")



loop
%When mario will jump on bricks flying in screen, it will check various conditions
    if posx >= 580 and posx = 270 and posy = 740 and posx = 275 and posy = 2900 and posx = 275 and posy = 3540 and posx = 275 and posy = 3760 and posx = 275 and posy = 4000 and posx = 275 and posy = 4110 and posx = 275 and posy = 4220 and posx = 275 and posy = 4440 and posx = 275 and posy = 4860 and posx = 275 and posy = 6340 and posx = 275 and posy = 5110 and posx = 202 and posy = 5260 and posx = 202 and posy = 5640 and posx = 202 and posy = 5830 and posx = 202 and posy = 6930 and posx = 260 and posy = 750 and posx = 2910 and posx = 3540 and posx = 3760 and posx = 4000 and posx = 4110 and posx = 4220 and posx = 4440 and posx = 4860 and posx = 6340 and posx = 5100 and posx = 5250 and posx = 5630 and posx = 5820 and posx = 6920 and posx = 1020 and posx = 78 and posy = 78 and posy = 1400 and posx = 78 and posy = 78 and posy = 1700 and posx = 78 and posy = 78 and posy = 2120 and posx = 78 and posy = 78 and posy = 6130 and posx = 78 and posy = 78 and posy = 6730 and posx = 78 and posy = 78 and posy = 1020 and posx = 150 and posy = 150 and posy = 1400 and posx = 250 and posy = 250 and posy = 1700 and posx = 290 and posy = 290 and posy = 2120 and posx = 290 and posy = 290 and posy = 6130 and posx = 170 and posy = 170 and posy = 6730 and posx = 170 and posy = 170 and posy = 5100 and posx = 78 and posy = 78 and posy = 5250 and posx = 78 and posy = 78 and posy = 5630 and posx = 78 and posy = 78 and posy = 5820 and posx = 78 and posy = 78 and posy = 6920 and posx = 78 and posy = 78 and posy  maxx - MARGIN then
        background_x := posx + (Pic.Width (numFrames1)) - maxx + MARGIN
    end if

%If Mario will jump over the bricks on ground, the Mario will stay there
if posx >= 740 and posx = 180 and posy = 2900 and posx = 180 and posy = 3540 and posx = 180 and posy = 3760 and posx = 180 and posy = 4000 and posx = 180 and posy = 4110 and posx = 180 and posy = 4220 and posx = 180 and posy = 4440 and posx = 180 and posy = 4860 and posx = 180 and posy = 6340 and posx = 180 and posy = 7940 then
        posx := 7940
    elsif posx = 2610 and posx = 3260 and posx = 5790 and posx 