Change the allowed angle of movement for platform

Get help using Construct 2

Post » Sun Oct 13, 2013 10:14 am

Hello everyone,

I am new to game programming so please do forgive my newbie question.

How do I change the allowed angle of movement for my platform character? At default it looks close to 45 degrees for angle of climbing a solid. How do I change that?

Thank you to anyone who is able t o share some knowledge with me
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sat Oct 19, 2013 12:32 pm

If I understand correctly you want to control which angle is considered a walkable slope and which angle is considered a wall.
Unfortunately, there's no slope control in C2's platform behavior.
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511

Post » Sat Oct 19, 2013 2:41 pm

@Yann thanks for your reply. Yup that's what I want to do. That's really too bad. I guess I will have to rethink my game concepts and designs.

After some testing, it appears that the maximum angle of slope movement is indeed 45 degrees. Hopefully the good people of Construct 2 might consider an option for this in their next release.
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sat Oct 19, 2013 2:48 pm

Hi All
Was wondering if a solution to this could be done by adding the bullet movement to the platform person have it disabled unless he collides with a sprite that is invisible meant to trigger the special angle movement then disable the bullet movement after the standard platform is reached perhaps another invisible trigger sprite to force this?
B
28
S
5
G
2
Posts: 76
Reputation: 3,085

Post » Sat Oct 19, 2013 3:06 pm

That's an interesting solution @Pennington Games.

I might be wrong, but if we do use the bullet movement for the character to climb the slope, won't the player lose control of the character during the climb? If we set the bullet movement to stop when the player presses a button, and the character is still halfway climbing up the platform, won't the character get stuck there?
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sat Oct 19, 2013 5:57 pm

@rekjl

Agreed there we would need to anticipate stopping in the middle.

So with that in mind if we want the player to stop then bullet movement would halt till key pressed for a direction to go up or down....

Perhaps a fun solution would be to force it to slide down if halted.

Basicly the movement on a custom angled slope would be handled much in the same way as we code in ladders and ropes...

Not only can you create custom movement for this but you could slow him down as the angle gets steeper. Giving the game some fresh dynamics. Throw a few rolling boulders or barrels etc. now we need to code in jumping for our custom movement.

Again I am speaking only from a this is the way I might go with this. I am very new to CS2
B
28
S
5
G
2
Posts: 76
Reputation: 3,085

Post » Sun Oct 20, 2013 4:16 am

Haha I am very new to construct 2 as well @Pennington Games.

I am poor in programming, so maybe someone else can confirm this, but your solution does make perfect sense in terms of the logic. Haha might take a lot of events to get it to work properly, but it is worth a try indeed! Thanks!
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sun Oct 20, 2013 5:11 am

Found this game in Scirra's arcade and it has angles with movement that are not all 45 degree. So it can be done just needs custom movement to do.

http://www.scirra.com/arcade/addicting-action-games/5562/the-axis-full
B
28
S
5
G
2
Posts: 76
Reputation: 3,085

Post » Sun Oct 20, 2013 8:39 am

Thanks for that link @Pennington Games.

I tried the game out, but it looks like the two slopes in there are both under the 45degrees mark.

Actually, I am getting close to a solution. I use the on collision with the sloped platform as a trigger. Than check whether to see if the angle is between the angles I am looking for. And also to check if the correct key is pressed, I perform the sprite move at angle action. I set the angle to the same one as the platform, and + or - depending on the movement direction.

It works well to certain extent. It moves only once, so I need to continue to press. I can't use the on key press down because it is a trigger and I already have one trigger with the collision detection.

I am going to try the bullet option next. Hopefully I will be able to find a workaround to this.
B
42
S
20
G
31
Posts: 685
Reputation: 20,221

Post » Sun Oct 20, 2013 5:37 pm

@rekjl
Glad to see you are not giving up

You may find it useful to use groups which can be activated and deactivated in the system actions this way you can use the same type of key press for two actions. Depending on which group is active.
B
28
S
5
G
2
Posts: 76
Reputation: 3,085

Next

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], marc254 and 5 guests