Sonic The Hedgehog's Homing Attack

Get help using Construct 2

Post » Wed May 15, 2013 8:15 pm

Hey guys!

So I had an idea for this game. Basically, it's a platformer.
I wanted to give the character a Homing Attack, just like Sonic's.

Initially, I thought of something like this:

Keyboard: On [jump button] pressed
Player: Platform is NOT on floor

-> Set Platform Vector Y to 0
-> Set Platform Vector X to [some number]

Of course, I'm verifying which side is the player looking at.

Thing is, whatever the number I use on the Vector X the character goes just a bit to the left (or right), to the point I'm currently using 40000 :P
The Y Vector to 0 is working fine though.
This event probably doesn't work when the platformer is not on the floor.

Any ideas?
Thanks in advance :)
B
52
S
10
G
6
Posts: 133
Reputation: 8,715

Post » Wed May 15, 2013 8:36 pm

Set vector X and Y work for me when doing my Wall Jumping while not on the floor.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed May 15, 2013 8:43 pm

I'd deactivate the platform behavior, set a var to 1, and while that var is 1 move your player by angle(self.x,self.y,enemy.x,enemy.y) until collision, then restore platform behavior and set var to 0. Bada bing, bada boom. Don't forget to pick nearest enemy.Tokinsom2013-05-15 20:44:37
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Wed May 15, 2013 9:11 pm

Great idea! I'll formulate on that!
Thanks Tokinsom :)

BTW BluePhaze, Vector X did work with me, but I had to mess with max acceleration, speed and other platform behavior stuff that just wouldn't give me the result I was looking for. Also, I love your tutorials. ^^
B
52
S
10
G
6
Posts: 133
Reputation: 8,715

Post » Fri Jun 14, 2013 7:21 pm

I'd like to get a bit more detail on this, myself, as I'd like to have something similar in my own game.
B
19
S
2
G
1
Posts: 11
Reputation: 2,089

Post » Sat Jun 15, 2013 5:33 am

What kind of detail?
B
52
S
10
G
6
Posts: 133
Reputation: 8,715


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 24 guests