I am trying to do an isometric game for a university project and i have absolutely no clue on whatever regards programming, coding and the way of thinking behind all this. I decided to first create the background on Photoshop (place all the assets, editing) and then split the final image in nine squares so the game would run easier. I proceeded with that idea cause i had in mind i would be using blocks to create the path that my player would walk on to. When i placed the blocks on the entire image (and sadly checked if it works after i was finished with placing every block), i realized that i didn’t consider my players size between the blocked areas with the result of the player not be able to move. After spending time to increase the distance between the blocks i realized that the roads were too small for that.
So i hope and wonder if there is a way to create a new path over the roads that can be seen on the attached image. In other words, instead of blocking (left and right, up and down) the area, can i place a new path over the background picture and make the player walk only on that path (which i would like to make invisible afterwords)?
Thank you for your time.
I’m not sure you can invert the pathfinding logic like that… not easily anyway.
Did you delete all the walls you placed?
You can edit the hitbox of your player to make it smaller, or, if you need the real-size hitbox for another aspect of your game, you can create a separate smaller invisible object that will be used for pathfinding between the walls. You just need to place the player on its position.
Hope that’s clear!
Thanks for replying! No, i didn’t delete all the walls, i just had been trying to make them smaller and shorter by the inch and by moving the player one step at the time.
I have already changed the size of the player but it didn’t help much, cause if you take a good look at the image, many of the roads i created are too small. I checked the pathfinding option but i would like for the player to be moved by the keyboard so i think this is not an option for me.
Could you please explain or give me more info about the other option you mentioned? As i understood you say that i could create an object just as the blocks/walls i created and attach/place it in front of my player and then what? Is it gonna work with the pathfinding option only, or is there any other solution?
Thank you kindly.
Sorry, I read path and associated that with the pathfinding
So, what I meant was either:
- change the size of the hitbox of the player (not the player itself, just the hitbox).
- create a new object, assign the top down behavior to it (for keyboard movement), and give it a very small image (5*5 px for instance). Then hide the object, and add a position action to place the player on the position of that object.
Don’t forget to remove the top down behavior from the player if you added it.
I have been trying to find a way to change the hitbox itself, but i don’t seem to find my way out yet and when i tried to check if i could crop any transparent area from the original assets of the player through Photoshop, i remembered that i had done it in the past. I tried the second choice you gave me but i am pretty sure i didn’t quite understand what i need to do. For example, i tried to place the player on the new box i created (without hiding the object so i would be able to see if it is moving) and the result was for the new object to start moving around and the player being static. I must be doing it wrong.
Thanks again for your time. Really appreciate it!
You must add a position event that keeps positioning the player on the box.
Here’s an example from the platformer tutorial:
I have seen this one already but it didn’t seen to work. After hours of trying to edit the hitbox as you suggested, i found by accident the ‘‘edit hitbox’’ box and it worked! I only wish i hadn’t spent my day reforming all the block walls i had created yesterday
I had opened the player’s edit object window but i hadn’t scrolled down so i couldn’t find it
Anyway it took me a while but with your help i did it.
Thank you very much! Best wishes