-
hello,
i am currently working on a mario like game, and i was wondering how to get a jump thing. where you can jump a certain height from your starting position, but you fall back down after.
also, if anyone can help me with scenario scrolling, i would be gratefull. thanks
-thanks
-t_dawolf
-
Put the following code into a module. To use it, place an Image or Picture on Form1 and also place a CommandButton. In the CommandButton's Click() event place the code Jump(Form1.Image1)
Code:
Function Jump(VarVal As Control)
tmpTop = VarVal.Top
PauseTime = 0.2
Start = Timer
Do While Timer < Start + PauseTime
VarVal.Top = VarVal.Top - 1
Loop
Finish = Timer
Pausetimer = 0.2
Start = Timer
Do While Timer < Start + PauseTime
VarVal.Top = VarVal.Top + 1
Loop
Finish = Timer
Pausetimer = 0.1
Start = Timer
Do While Timer < Start + PauseTime
VarVal.Top = tmpTop
Loop
Finish = Timer
End Function
-
See my website for a scrolling demo... also you'll find BitBlt and animation demos ;)