0

I'm using the Platform Behavior in Construct 2 for a Windows 10 game. In addition to the arrow key, I would like to use the Space bar to get the sprite to jump. Can I tell it to call into the Platform behavior somehow or get it to let me map space bar as well as up arrow to 'jump'?

Joe Healy
  • 5,769
  • 3
  • 38
  • 56

2 Answers2

2

You certainly can. You can use an action called "Simulate Control" to simulate pressing left, right, or up. So as your event, use Keyboard->on Key Pressed (Space Bar). Then for the action Player->Simulate Control (Up Arrow). This will allow you to press space bar to have your character jump. Additionally, you can turn off default controls for the platform behavior and do custom controls for left, right, and up using the same strategy.

James Q Quick
  • 429
  • 3
  • 5
1

The best way to go about doing this is by adding an event that handles the Space Button. Make sure to add the keyboard object in your layout, and in the event sheet, you want to make an event that handles the keyboard -> on key pressed (choose the spacebar when asked) -> choose whatever object you want to jump with the Platform behavior -> Set Vector Y to whatever increment you'd like to jump. Be sure to list this value as negative. The y-axis in C2 is inverted, so negative numbers mean up.

Hope this helps!

Gavination
  • 78
  • 1
  • 5
  • I'd like it to match the same "jump" as the [up-arrow] from the Platformer. Any idea how to match magnitude of platformer up arrow to a "set vector y". Thanks for the dialog.... – Joe Healy Oct 30 '15 at 13:59