Top-down collision

Get help using Construct 2

Post » Tue Aug 21, 2012 9:34 pm

I know this is a dumb question but how do you detect top-down collision? I'm trying to remake a game I made in GM (Realm Quest) in C2 and I don't want the player to move over the trees.

I'm only using the solid behaviour on both trees and player and don't know how to prevent the player going over the trees!

I'm using:

Keyboard -> On Right Arrow pressed -> Set X to SpriteX+32

to move. What condition do I use to say "don't move right if next to a tree on the player's right"?Nickydude2012-08-21 22:57:09
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Wed Aug 22, 2012 12:55 am

Have you tried using the 8-way behavior on your player object?

The programming should be

IF player collides with object (tree) : player -> stopandreyin2012-08-22 01:01:50
B
106
S
35
G
36
Posts: 792
Reputation: 24,703

Post » Wed Aug 22, 2012 1:16 am

Yes I have but I want the player to "jump" in steps of 32 pixels at a time without any acceleration or deceleration.
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Wed Aug 22, 2012 4:02 am

andreyin, how would you get the player to just 'stop'?
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Wed Aug 22, 2012 3:16 pm

Check out the pacman tutorial. It uses grid based movement and checks for walls before moving.
http://www.scirra.com/tutorials/308/cloning-the-classics-pacman
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990


Return to How do I....?

Who is online

Users browsing this forum: Radulepy, tarek2, TiagoCesar and 20 guests