Author Topic: Player Sprite Jumping Question  (Read 5303 times)

Superjeep3

  • Visitor
  • *
  • Posts: 10
    • View Profile
Player Sprite Jumping Question
« on: 2005-08-12, 06:52:11 PM »
In SDK, is it possible to have the jump button defined as a direction?  I noticed in the scripting wizard, it has an option for jump, and I asume this is to make the player sprite jump.  If this is so, I can not have 4 weapons in the game as they would take up my four scripting buttons.  Is that right?  Can I assign a direction button to jump?  So if A,W,D,S were my direction buttons, and it is a side scrolling game, can the W button be my jump button, or am I missing it somewhere else?

Is it possible to have more than four scripted buttons using the scripting wizard?

What I am wanting in the game is 3 directions, left, right, jump...4 weapons (pickups)fired by 4 buttons...and one button used as a health regn (pickup).  so that would be 3 direction keys and 5 buttons.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Player Sprite Jumping Question
« Reply #1 on: 2005-08-12, 07:14:42 PM »
whatever your up button is set as is automatically your jump button.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

Superjeep3

  • Visitor
  • *
  • Posts: 10
    • View Profile
Player Sprite Jumping Question
« Reply #2 on: 2005-08-12, 07:22:53 PM »
your post kind of confused me, are you talking about the up button on the keyboard, as in the direction button, or what ever you define the up button as in the controls, so if I set the up button as spacebar, then jump is space bar?  Thanx, and sorry about the confusion.

Superjeep3

  • Visitor
  • *
  • Posts: 10
    • View Profile
Player Sprite Jumping Question
« Reply #3 on: 2005-08-12, 08:02:17 PM »
I think I figured it out

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Player Sprite Jumping Question
« Reply #4 on: 2005-08-14, 07:59:52 AM »
I have two more tips for you:
1) Since you are not using the down button for anything you could define the down key to be anything you wanted as well.  The scripting wizard does not allow you to define the down key to shoot, but you could still use the down button for any kind of function you want within the project -- for example, it's easy to drop bombs without writing script so you could define the down key to "drop a bomb" or something.
2) If you are trying to trigger special functions with different keypresses, there are many more than just 4 buttons you can use to do this.  Yes, you can define Buttons 1, 2, 3 and 4 to have different functions, but then you could also define different functions for when you are holding the down key at the same time as button 1, 2, 3 and 4.  So that's 8 different functions right there.  You could also define different functions to activate when you hold button 1 while also pressing button 2, 3 or 4.  This is all accomplished by using the "All at Once" option in the function activation parameters.  It gets tricky if you have functions for all the buttons on their own, and then you also want to define (for example) Down + 1 to be a different function.  When you press down and button 1 at the same time, you may see that two functions will activate: one for button 1 and one for Down + button 1.  There are two ways to deal with this: a) Don't define functions for single button presses if you have lots of functions you want to activate.  You could allow the player to only shoot when he is pressing two buttons at once, for example: Left+Button1-4 shoots one of 4 weapons to the left (this doesn't even require scripting), Right+Button1-4 shoots one of 4 weapons to the right, Down+Button1-4 shoots 4 different kinds of weapons that don't need to know whether you are going left or right.  b) Use the "And nothing Else" option in the function activation parameters.  If a function is designed to activate when you press Button1 "and nothing else", then it will not activate if you are pressing down and button 1 at the same time.  Then you can define a different function to activate if the player presses button 1 while down is already pressed.