PDA

Click to See Complete Forum and Search --> : If space+right arrow clicked then sprite.move up an forward


AddeLiss
May 12th, 2000, 09:23 PM
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

Fox
May 13th, 2000, 12:30 AM
you handle the input wrong I think. Did you put the move code in KeyDown or KeyPress???

kedaman
May 13th, 2000, 01:53 AM
Pasting some code here will help us find your problem

kedaman
May 14th, 2000, 08:57 PM
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

AddeLiss
May 14th, 2000, 10:34 PM
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

Dayo312
May 15th, 2000, 02:31 AM
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!