How do I make my enemy jump [Platformer]

Get help using Construct 2

Post » Thu Jan 08, 2015 3:00 am

@nickl
Why do we need a to create a global variable for the enemy's speed?
I thought variables' names had no value - does adding "speed" refer to the set speed of the object? (in this case the enemy's)
B
5
Posts: 38
Reputation: 301

Post » Thu Jan 08, 2015 6:20 am

@PixelBoss
That global variable is not strictly necessary. In events 1 and 3 we check to see if the enemy has line of site to the player, if it does we tell the enemy to move towards the player at EnemySpeed. Having the EnemySpeed variable means we can just change the EnemySpeed from 3 to 2 to make the enemy move slower, or change it to 4 to make the enemy move quicker.

We could remove EnemySpeed and hard code the speed values in events 1 and 3 instead if we wanted.

Also, calling the variable EnemySpeed is just a name, we could of called it anything, it's just used to set the rate at which we move the Enemy along the X axis.
Double click the EnemySpeed variable, change it's name to anything and C2 will update the events that used EnemySpeed with the new name.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Thu Jan 08, 2015 7:58 pm

@nickl I understand now :) so they work like gears in a car. I had not thought about implementing different speeds, so that's why I didn't understand.

Once again, thank you very much for teaching me. I think after a few mour hours spent on C2 I may end up buying it - the 4 layer limit really rustled my jimmies.
B
5
Posts: 38
Reputation: 301

Post » Fri Jan 09, 2015 7:56 am

@PixelBoxx Your welcome.

If your thinking of purchasing C2 I really can't recommend it enough. I've tried GMS, AGK2, Unity, Phaser.io and probably more, but C2 is the one I use. However, as with most things, it's not the tool it's how you use it .. and how much FUN you get from using it :)
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Mon Jan 12, 2015 10:25 am

@nickl

Wow, I really appreciate that last comment, because I've been thinking about other softwares too.
Thank you so much for your mini lessons and feedback. You've won a cyber-beer as a token of my appreciation (granted that you're of legal age and like beer, otherwise please accept an e-cookie).

Please do let me know if I can do anything for you, like testing a game.
B
5
Posts: 38
Reputation: 301

Previous

Return to How do I....?

Who is online

Users browsing this forum: Centra, DarknessGamingDK and 2 guests