I am trying to make 2d RPG game with grid movement (one square movement only allowed)
I already done grid movement for player. I can move all 4 directions and if there is collision on the right for example water I can't even start moving in that direction.
I found pretty hard to do that on monster.
What I want to do:
What is done:
What I struggle to do:
-Monster following player until he is in 1grid LOS, if player will move monster will start chasing again
now: monster jumps into player and he is not always in his grid.
-When monster have collision for ex. on the right don't allow him to move there, go around that if chasing player.
now: When monster in collision with another monster or ground object, he is moving pixel by pixel or stopping.
Can someone help me with that?
I found that movement is hardest part for especially on monsters and it already consumed a lot of my time.
I think that if I complete that part the rest won't be that problem since Construct2 is very enjoyable for me.
Thanks for every advice
Develop games in your browser. Powerful, performant & highly capable.
This game will be very hard to make without the pathfinding, but the standard behavior doesn't work with tilemaps.
There are a few plugins for grid-based pathfinding, you definitely should check them out:
Also, Bullet behavior is inaccurate and hard to control. Instead of Bullet, use MoveTo, it's a great behavior, very easy to use:
Why do you have like 6 or 7 tilemaps on top of each other? Usually you need 1 tilemap with Solid behavior where you define tiles like walls and trees. And another tilemap with grass and all other scenery objects that you can walk on.
Hi, I don't have a specific solution for your question, but I recommend investing time in learning Rex's Board plugins and behaviours. I've used this extensively (although I'm using this for isometric, the principle of the plugin is the same for orthographic) and I found they solve many of the problems you describe.
For example, it is easy to query if a particular 'chess' piece is a neighbour of another (instead of doing your own function). You can also query how many movement tiles away two 'chess' pieces are.
Rex has also implemented pathfinding, too.
However, it takes a bit of patience to learn all the capabilities because the Rex's 'Board' system is composed of several plugins and behaviours. You don't need to use all of the plugins or behaviours, just the ones you think you need. I really recommend giving it a go. If you're stuck with an issue, you can just ask, and perhaps I (or even Rex) could offer some suggestions using the Board system.
(I've always wanted to do a Rex Board tutorial series, but I haven't had enough time. )
dop2000 I shouldn't have 6/7 tilemaps I just messed up smth while I was starting that project and I didn't understand few things. I will definitely solve this
Thanks for the examples I will definitely check them and try to implement.
It looks like I was trying to invent a wheel, but someone done it far better than I would ever done. Thanks for that, I will surely Investigate the Rex's plugins.
ahh I love you guys. Thanks both of you for replies
I will give feedback after some time.