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

Username:   Password: 
 RegisterRegister   
 sprites help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
metachief




PostPosted: Mon Feb 04, 2008 4:59 pm   Post subject: sprites help

proc game

Window.Hide (main_win)
campaign_win := Window.Open ("position:centre,centre,graphics:850,610,title:CAMPAIGN")

var left, right : boolean := false
const grav := 1
const jump_s := 1.2
var run_s : real
var x, y : real
var vel_y : real
var jump : boolean
var key : array char of boolean

run_s := 13
x := 400
y := 8
jump := false

View.Set ("offscreenonly")

loop

Input.KeyDown (key)

if key ('a') then

loop
right := false
left := true

Pic.Draw (pic1l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic2l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic3l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic4l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic5l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic6l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic7l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic8l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic9l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls

Pic.Draw (pic10l, round (x - 70), round (y), picMerge)
x := x - run_s
delay (60)
View.Update
cls
exit
end loop
end if

if key ('d') then
loop
left := false
right := true
Pic.Draw (pic1r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls


Pic.Draw (pic2r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic3r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls


Pic.Draw (pic4r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic5r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic6r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic7r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic8r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls


Pic.Draw (pic9r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls

Pic.Draw (pic10r, round (x), round (y), picMerge)
x := x + run_s
delay (60)
View.Update
cls
exit
end loop
end if

if key ('w') and jump = false then
jump := true
vel_y := jump_s
Pic.Draw (pic11r, round (x), round (y), picMerge)
View.Update
cls
end if

if jump = true then
if y < 200 then
jump := false
end if
y := y + vel_y
vel_y := vel_y - grav
end if

end loop

Window.Close (campaign_win)
Window.Show (main_win)
Window.SetActive (main_win)

end game
Sponsor
Sponsor
Sponsor
sponsor
StealthArcher




PostPosted: Mon Feb 04, 2008 5:17 pm   Post subject: RE:sprites help

What do you even want?

And, USE CODE TAGS.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: