0 Favourites

How do I stop my sprite with another object

  • 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

  • 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..

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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

    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

  • 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..

  • 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
  • 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.

  • lStEpHl

    I'm glad i could help you

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,330
RetroDaddy's avatar
RetroDaddy
Unread hot topic
86 28,714
St4rDu57's avatar
St4rDu57
Unread hot topic
99 10,139
karshinkoff's avatar
karshinkoff