Quantcast
Channel: 2D Latest Topics
Viewing all articles
Browse latest Browse all 623

sprite overlap of different shapes without physics arcade

$
0
0

Hi everyone,

I wanted to test if two sprites are overlaping withouth physics2d. Sprites are of a different shape.

I found this function in phaser docs. If I understand right, it should check if first sprite overlaps given object, in my case another sprite.
Phaser.Sprite.overlap(displayObject) : boolean;

I use this like

if (player1.overlap(player2)) ... else ...

where both players are sprites. Am I using this wrong, or this function is deprecated because I get an error that this function does not exist.

If is possible to check overlap with this function please tell, because i made a project without physics2d and i don't want to make a lot of changes now.

Thanks ahead.


Viewing all articles
Browse latest Browse all 623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>