wertt22 As I understand, your code will detect collision in this red point: You need to check if dec sprite overlaps both sprites. But this is a very ineffective method. With sprite size 300x300 px, the loop will repeat 90,000 times and there will be a considerable lag.
wertt22 As I understand, your code will detect collision in this red point:
You need to check if dec sprite overlaps both sprites. But this is a very ineffective method. With sprite size 300x300 px, the loop will repeat 90,000 times and there will be a considerable lag.
my sprite point0 is set at your red position
My code needs to be optimized. If the sprite is very large, it needs to narrow the scope of judgment
Develop games in your browser. Powerful, performant & highly capable.
or you can create one detcor an set IT position use loop ,i think is more caculate if you have a big Sprite
i have a idear ,you can create detcorSprite useloop for 0 to Spritea.width for 0 to Spritea.height when collision happen,and find which detcor is overlapping two main Sprite ,so this detcor position is you want....
or set a mini Sprite pin rope to your shape Sprite and set the mini Sprite move angle same to your shape Sprite
set point for your Sprite shape and let the mini bullet Sprite move angle from point first to last
bullet angle need +1 everytick
create a mini bullet SpriteC move angle from A TO B when C is overlaping A and B you can find the collision point
ok thanks
sometimes i need refresh tilemap ,and the physics Sprite will inside the tilemap
sometimes physics Sprite S it gets stuck inside physics tilemap,how to solve it
Member since 29 Jan, 2016