Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mario/Moving Background Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ahmed




PostPosted: Tue Jun 01, 2004 12:15 pm   Post subject: Mario/Moving Background Help

so this program allows the background to move so basically change the picture names but if i want to make a mario game which one of the picture do i change to mario and which on do i change to the backgrounds lvl.


jamez wrote:
code:


setscreen ( "graphics:1000;700,offscreenonly")
var x,y : int
var sky : int
var ship : int
var backgroundPictureWidth, backgroundPictureHeight : int
var backgroundPictureX, backgroundPictureY : int

ship := Pic.FileNew ("c5.bmp") <--
sky := Pic.FileNew ("sky.jpg") <--
backgroundPictureWidth := Pic.Width (sky)
backgroundPictureHeight := Pic.Height (sky)
backgroundPictureX := (backgroundPictureWidth - (maxx + 1)) div 2
backgroundPictureY := (backgroundPictureHeight - (maxy + 1)) div 2



x:=100
y:=100
var chars : array char of boolean
        loop
       
        Input.KeyDown (chars)
            if chars (KEY_UP_ARROW) then
                y:=y+15
            end if
            if chars (KEY_RIGHT_ARROW) then
                x:=x+15
            end if
            if chars (KEY_LEFT_ARROW) then
                x:=x-15
            end if
            if chars (KEY_DOWN_ARROW) then
                y:=y-15
            end if
View.Update
delay(10)
            cls
            Pic.Draw (sky, -backgroundPictureX, -backgroundPictureY, picCopy)
            Pic.Draw(ship,x,y,picMerge)
            View.Update
        end loop


[mod:985ad0c96b]Next time, please post in the relevent section, thank you[/mod:985ad0c96b]
Sponsor
Sponsor
Sponsor
sponsor
Flashkicks




PostPosted: Wed Jun 02, 2004 7:45 am   Post subject: (No subject)

Im not even sure- My pictures wont even draw.. Confused Are you sure you have the background stuff right??.. Bcuz if you comment it out it WANTS to run but cant bcuz its not recognizing the pictures. Check that you made sure you put them in correctly-get help with the backgroundPicture demand thingy... I would help you with that as well but unfortunately im being LOADED with Java crap right now- for finals Shocked ... Unfortunately have no clue as to what i am even really doing..lol.. but Im learning. JAVA IAS HARD. Anyhoo- Yeah- see if you can get the pis to werk. if yours do; then SOMEHINGS wrong with mine....
~Flashkicks
rhomer




PostPosted: Wed Jun 02, 2004 9:50 am   Post subject: (No subject)

Ok...First of all what are those arrows for?? they screw up your program..

secondly if you have pictures you should post them with your ".t" file in a zip file.
Flashkicks




PostPosted: Thu Jun 03, 2004 7:33 am   Post subject: (No subject)

{ Aha- those were my thoughts too Razz }

ACHOO hint hint Laughing
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: