Hi!
I'm making a SuperMario kind of game.
Right now, I need help with jumping forward.
With my code the mouse (who is my SuperMario) stops running forward when I press the jump button (space)
Please help!
/Anders
Printable View
Hi!
I'm making a SuperMario kind of game.
Right now, I need help with jumping forward.
With my code the mouse (who is my SuperMario) stops running forward when I press the jump button (space)
Please help!
/Anders
you handle the input wrong I think. Did you put the move code in KeyDown or KeyPress???
Pasting some code here will help us find your problem
First, don't use timers, they're inexact and slow. If you need to use timed functions then use a loop with doevents instead.
Secondly, i don't like your idea of dismissing gravity like that. To make a Supermario game you need to learn the valuation of using variables. You need to set up a speed vector to your dude consisting of a x and y variable or an UDT of them, to make proper acceleration of him. Then you could easily make him jump like this:
'For gravity
If not hitfloor and dude.vy<20 dude.vy=dude.vy+1
'For Jump
dude.vy=dude.vy-20
And when you hit your guy against something you can make him bounce in the opposite direction, negating the values or just reset to make him stop. For moving your guy you can trap them in keydown (keycode) as vbkeyleft and vbkeyright.
'For moving to right with smooth acceleration:
If dude.vx<10 then dude.vx+1
Oh, I think I'll just start over and try to learn something about game programming before I try anything stupid :)
Do you probably have any links to a Game Programming-school?
Or a good tutorial?
/Anders
I got a link!!!
ALL of that stuff he said to
do is done in a game called
'Lander'.
I learned alot from it,
Just go to
http://www.Vb-world.net
And look on the page for
the tutorial "Lander".
Hope that helps!