Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

aabb javascript

var rect1 = {x: 5, y: 5, width: 50, height: 50}
var rect2 = {x: 20, y: 10, width: 10, height: 10}

if (rect1.x < rect2.x + rect2.width &&
   rect1.x + rect1.width > rect2.x &&
   rect1.y < rect2.y + rect2.height &&
   rect1.height + rect1.y > rect2.y) {
    // collision détectée !
}

// remplissage des valeurs =>

if (5 < 30 &&
    55 > 20 &&
    5 < 20 &&
    55 > 10) {
    // collision détectée !
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: get pods on specific node 
Javascript :: how to call await outside async function in js 
Javascript :: javascript validate number only 
Javascript :: js draw square to canvas 
Javascript :: javascript sort array by A-Z in js 
Javascript :: add event listener on modal close 
Javascript :: flutter wordspaceing 
Javascript :: javascript moeda reais 
Javascript :: js split text on spaces 
Javascript :: phone number regex angular 
Javascript :: m- m sequelize 
Javascript :: hide bootstrap modal jquery 
Javascript :: export type you may need an appropriate loader to handle this file type 
Javascript :: get buffer from jimp js 
Javascript :: how to add react scroll scrollable link 
Javascript :: javascript detect collision 
Javascript :: replacing characters in string javascript 
Javascript :: javascript typeof undfined 
Javascript :: Unable to resolve module `@react-native-community/toolbar-android 
Javascript :: javascript middle of array 
Javascript :: javascript reference file two folders up 
Javascript :: jquery append once 
Javascript :: js select class 
Javascript :: how to make a screen recording software with js 
Javascript :: a quick introduction to pipe and compose javascript 
Javascript :: query params vuejs 
Javascript :: ajax csrf token laravel 
Javascript :: on page fully loaded jquery 
Javascript :: min object value in array 
Javascript :: fs get random file in folder 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =