Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I think you should really think about how you check for collision 😂 you dont need to write the check for every wall that you have..
-
Deef307y@sharktits I have to use collision function create by my prof it's in the rules of homework and yes i use map to made it easier. But Thx, I just have to think about all differents case, like when i'm between this two wall i just can go forward or backward but not on side....
-
Deef307y@simulate yeah I know but i think the probleme is the collision function of my prof, because it dont care of it's collision just on one side or all of my character. So I have to write condition when i dont care of this or this collision and when I can move enven if there is a collision...
-
@Deef
I dont think you need that many if statememts.. Just check whether the tile your player wants to move to is a wall, and if so, there is going to be a collision eg. the move is not allowed.
To check this you just enumerate all the types of tiles (path=0, wall=1, pit=2, ...) and store these type ids for each tile in an array so that you can access it with xy coordinates.
I dunno, it sounds like you are making it way to complicated 😉
When you have to made a little game with javascript, and because it's your first game you made a beautiful maze with lot of wall.
Ahahah... i'm shit.
I forgot wall have collision.
I'm here now, with 40 different fuckin' walls and much if and else if conditions.
I hate me.
Yeah i know, I can just change my maze but no... I'm lazy. Cry against the collisions is better.
Have good day.
rant
lazy
condition
if
collisions
game
else if
javascript
maze