How do I stop my sprite with another object

Get help using Construct 2

Post » Sat Sep 19, 2015 2:54 pm

Here is my probleme.
I would like to make a basic pokemon-like gameplay, so i find a way (maybe not the best) to make my sprite move, but when it encounter an obstacle, (grey cases : tilemap set as solid, or even another sprite) it don't stop, it keep moving but in another direction.
could someone please, explain to me what should i change.

It might could work with the behavior : 8direction but i don't know how i could keep the case by case effects

I will ad the capx when i could
B
8
S
2
Posts: 4
Reputation: 650

Post » Sat Sep 19, 2015 3:04 pm

Without having any idea on how you have your movement events set up it will be impossible to answer this question..
You have "a way" to make your sprite move and now it moves, but also to places you don't want it to move..
I guess adding a condition to the movement event to only move to places you want it to move should work..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Sep 19, 2015 5:44 pm

the things is that i don't know what condition i have to add
it might be super simple, but for now i didn't figure out what :roll:

here is the capx
https:/ /www.dropbox.com/s/k0263j04ndxlkqa/deplacement%20pokemon%20obstacle.capx?dl=0
(delete the space between / / and it should work)

to be clear, my probleme is :
when my sprite move and if it is in front of a solid obstacle, for exemple i press "right", it will go "down" or "up" and i just want him to don't move
Last edited by lStEpHl on Sat Sep 19, 2015 11:06 pm, edited 1 time in total.
B
8
S
2
Posts: 4
Reputation: 650

Post » Sat Sep 19, 2015 5:55 pm

Seems to me you should check the tile the player is moving to prior to moving the player to it..
So only move the sprite if it's destination is tile2..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Sep 19, 2015 6:43 pm

@lStEpHl

Hi :)

Please excuse my english, but i hope you will understand me.

Maybe it's not the best Solution but I've found an option for your movement.
If you're sure you want to stay to this Movement, you can try this out: lStEpHl_Movement.capx

If you're not sure yet, i would recommend you to use the "8-Direction" Movement. There wont be a Problem anymore with your Solid Tilemap.

I hope you can work with that! :)


Regards
- vendara
B
9
S
2
Posts: 50
Reputation: 700

Post » Sun Sep 20, 2015 8:55 am

Oh yeah thanks :) I didn't think of a sensor, it work well even with animations.
maybe if i modify the sprite it could even work without the sensor.

The probleme with the 8 direction behavior is that the movement was fluid and I wanted a case by case movement, but I guess I don't need it anymore.

Tanks guys.
B
8
S
2
Posts: 4
Reputation: 650

Post » Sun Sep 20, 2015 2:53 pm

@lStEpHl

I'm glad i could help you :)
B
9
S
2
Posts: 50
Reputation: 700


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests