Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jumping Platform games
#1
Ive only recently got back into qbasic and already im struggling. Im doing a basic platform game, using characters jumping from platform to platform until they reach the goal. My problem is how to identify what the character cant go through (plus my jumping itself isnt too good). Ive looked over the net for a while and only managed to find one thing, but the problem is my game is in screen 0 and i cant find a way to stop things falling without using the POINT command. If someone could help me with either some code for jumping or some code to help with defining the platforms i would appreciate it a lot. By the way my character is just an ascii character and so are all the levels made up of them.

thx in advance.
img]http://xerosis.sheer-design.com/images/mo48.jpg[/img]
Reply
#2
Use an array to hold your game world, don't rely on the screen's contents. If you check your character positions against the array, not only is it faster but it's more reliable.
I'd knock on wood, but my desk is particle board.
Reply
#3
maybe i should of put this in beginner help :???:
img]http://xerosis.sheer-design.com/images/mo48.jpg[/img]
Reply
#4
I dunno what you've got already... but if you want a decent-looking parabolic jump:

Consider every co-ordinate as a floating-point value. Then, whenever an object does not have a firm surface below it, increase its vertical-velocity by whatever the gravity factor is.

When you want to jump, instantaneously set the vertical-velocity to some negative number... your character will jump upwards, gradually be slowed down by gravity, drop again, and speed up as he falls. Exactly as it should be.

And before you write anything to the screen, just round off your x and y positions to temporary variables and use those in your LOCATE. (If speed becomes an issue, there's a much quicker way to write to the screen using DEF-SEG and POKE -- memory address is B800:0000)

Mike
Reply
#5
A platformer in text mode?!? (memory address is B800:0000) :-?

But yes (simplification follows!), gravity is a constant acceleration, which means that the y velocity of an object affected by gravity will change linearly, and the y position will change exponentially, as in a parabola.
Reply
#6
Platformer in text mode:

http://usuarios.lycos.es/firstqbasicforu...nadya.html

Big Grin

(you can grab complete source code of how it works, I think I remember that it was somewhat commented, but I may be wrong).
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#7
Sounds like fun.... How would you go about making something like that in the first place? I'm so newbish sometimes that I surprise myself. I can figure out most simple mathematical equations, and I think I'm good, lol. Keep us posted on your progress, and post some code and whatnot! Big Grin
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)