Custom Platform Style Movement

For questions about using Classic.

Post » Tue Sep 07, 2010 5:52 pm

Hello all, I'm relatively new to Construct but used to use TGF2 extensively.

So far I'm loving Construct and finding it to be a brilliant tool for prototyping some of the ideas I'm working on.

Anyway, I've looked for help and experimented a fair bit but I can't seem to work out the most effective means of doing what I want.
I have a platform style game where the main character can walk, run and jump. However, I want the character to jump a specific distance while moving and do not want it to be affected by the speed of the movement. When the player is not moving and presses jump I want the character to jump a fixed distance straight upward. I'm intending on using a variable to specify the 'state' of the character for controlling which action will be carried out when the player presses the jump button.

My question is, what is the best way to handle the jumping? Is there a behaviour type that I can switch to upon pressing the jump button that will do what I want? It's very important that the jump distance remains a fixed distance in pixels so that levels can be built around it.

Posts: 4
Reputation: 633

Post » Tue Sep 07, 2010 9:02 pm

no need for a special behavior

cap is fairly straightforward
if the character is on the ground
set a pv "jumping" to 0
if the character is jumping set it to 1

if that pv==1 then move the character at a constant speed * the direction it was moving in

the only reason you can't do it one event, like this:
[code:36adq4t7]character is jumping
character is falling[/code:36adq4t7]
is because then falling off the edge would cause the character to move at that same constant speed if you just fell off a platform

if you want to make it so the character always falls straight down if you don't jump, then do
[code:36adq4t7]--character is falling
--"jumping" is equal to 0
---------set platform x velocity component to 0[/code:36adq4t7]
let me know if you have any additional questions
this cap will require one of the latest unstable versions to run:
Spriter Dev
Posts: 3,224
Reputation: 16,254

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests