Hello guys,
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:
- Monster can move in 4 directions grid (done but not perfect)
- Monster can move 1 square which is 16 pixels or don't move at all
- When there is collision on the right don't allow him to move there, go around that if chasing player.
- Player chasing (done, but not perfect, sometimes monsters move not 16pixels but less and they are out of their square)
- When monster will catch player, so player is 1 square from monster, stop moving to him (done, but not perfect, sometimes monster is moving onto player and sometimes monster is out of his grid)
- When player is not in monster's LOS he should get back to spawn point. (not done)
- Monster can't go on another monster grid and if there is collision he should always stay in his grid(center of 16pixels square) or go around another monster.
- Monster should go back to spawn point if not chasing player(grid movement one square at a time)
What is done:
- Player can move in grid and collisions are done perfectly.
- Player
- Monster is chasing player(target) if he is in certain LOS. Monster is moving one grid at a time(16pixels) with little stop between each move.
- Monster if doesn't have player in LOS is moving in randomly chosen directions.
- If monster is near player, is stopping(he should be able to still move, but not into player, but it is too hard)
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.
Scan:
https://www.virustotal.com/#/file/a6455c4b0d44b9764af6cc59702db2a1f130f217e77b40f7e654f4ba0f379f36/detection
Game: https://drive.google.com/open?id=1vWpEP9UCzIjGVhJTy1BOo9edwPU-_N4M
Thanks for every advice
Bartek