Platform: Crawling up walls

Get help using Construct 2

Post » Wed Jul 31, 2013 8:38 pm

Is there a way to make a sprite move left or right using the platform behavior, and then once it gets to a wall, it changes the angle of gravity so it starts to crawl up a wall?

I'm trying the following code, and it's not working:

Player.X < Sprite.X
---Sprite: Simulate Left

If Sprite.Platform.AngleOfMotion = 180 & Sprite has Wall on Left
---Set Sprite.AngleOfGravity = 180
---Sprite.Angle = 90

Any idea on why this doesn't work? My idea is to be able to basically have the sprite move towards the player always being on a floor or wall. Is something like this possible?
B
29
S
7
G
1
Posts: 493
Reputation: 3,294

Post » Wed Jul 31, 2013 9:19 pm


i tried it only with the "sprite has wall on left" condition and it kinda worked

it moved left and then fliped and moved up, this "If Sprite.Platform.AngleOfMotion = 180"
must be breaking it or something

now i only don't know how you will get it to turn again on an edge over the left wall... mine just flies away

keep in mind i'm a noob so i might not even trully know what you want.
B
4
Posts: 24
Reputation: 248

Post » Wed Jul 31, 2013 10:04 pm

Right - mine's doing pretty much the same thing. I'm still playing with instance variables, but that doesn't seem to be helping either.
B
29
S
7
G
1
Posts: 493
Reputation: 3,294

Post » Thu Aug 01, 2013 1:11 am

hey, if you haven't solved it aready ,you could try telling it to restore normal gravity if its not touching any ground or something ,after a short delay, so that the gravity itself push it to its place.
B
4
Posts: 24
Reputation: 248

Post » Thu Aug 01, 2013 2:31 am

Thats not a bad idea, but I don't think it will look fluid since the sprite will kind of "drop" a bit until it realizes there is nothing beneath it. I wonder if there's a solution with the bullet behavior instead?
B
29
S
7
G
1
Posts: 493
Reputation: 3,294

Post » Thu Aug 01, 2013 3:01 am

i think using bullet movement would require a lot of events to tell it how to follow the player for both sides and groud orientation.

HEY try using both 8directions and platform movement(only to get the "by wall" and "on ground" events, you should deactivate all setting parameters of the plataforming control like gravity and acceleration all that.),you can tell it to simulate left and right movement if its on ground ,and tell it to flip if it finds a wall and keep moving left and right on the wall following the players X and Y, and tell it to simulate down and then flip to normal gravity if it finds no ground(all these as 8 direction control)

i belive that with some finetunning on the settings you can get it to look quitte smooth!(like turning deacceleration to 4000 when it finds no ground to stop it going airborn)MustacheGolem2013-08-01 03:04:00
B
4
Posts: 24
Reputation: 248

Post » Thu Aug 01, 2013 7:11 am

@MustacheGolem - I think the 8-direction is a good idea. I'm having trouble implementing it completely, but it seems that the general idea works. Also, trying to get animations to work with it are a complete nightmare since there's no way to tell when a wall is about to end.

Has no one ever done this before?
B
29
S
7
G
1
Posts: 493
Reputation: 3,294


Return to How do I....?

Who is online

Users browsing this forum: alajajm, tetuan and 7 guests