Results 1 to 6 of 6

Thread: If space+right arrow clicked then sprite.move up an forward

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    3

    Question

    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
    Being sexy is a hard job, but someone has to do it!

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    you handle the input wrong I think. Did you put the move code in KeyDown or KeyPress???

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Pasting some code here will help us find your problem
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    3
    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
    Being sexy is a hard job, but someone has to do it!

  6. #6
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    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!

    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width