DEV Community

AndyBullet
AndyBullet

Posted on • Edited on

2

JavaScript and JQuery: I have three problem about movement and collision detection.

Hi Guys!
I have two problems about the movement and a problem about the collision detection(this is the code https://pastebin.com/k4QEnrtm) :

1- The button must be clicked two time to work, but I want that it works on a single click;
2- By "Down" button, the div teleports up before going down, and I don't know why;
3- The collision detection make always the text change from "true" to "false" and vice versa if the dives collide or not, and if the write is "true" the "Down" button must be disabled. The problem is that by clicks it works, but on mouse down it doesn't work.
Can you tell me how to solve these problems?

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay