Jump to content

Problem with body.touching.right/left


mau649612
 Share

Recommended Posts

Hello folks!

 

I'm having a problem, that i consider to be a strange bug...

 

take a look at my game: http://mauriciodev.com/jobs/games/crazy-square/

code: https://github.com/msodeveloper/crazy-square/

 

in the game, when the hero touches anything with his left or right part of his body, it changes the direction that its running...

 

so when it touches a wall, it goes to the opposite direction.

 

that works great, but the problem is that when it is walking OVER the floor, only touching the DOWN side, there are some random times that it changes its direction, how am I supposed to fix that?

 

you can play the game, and see what i'm talking about.

 

SPACEBAR jumps the character,

 

the line 32 is the function called invertDirection, in the file play.js

 

thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...