RhenaudTheLukark / CreateYourFrisk

Rhenaud The Lukark's Unitale fork
GNU General Public License v3.0
132 stars 56 forks source link

[Feature Request] Adds a command "CheckPPCollision(x,y)" #78

Closed HzMasterG6 closed 3 years ago

HzMasterG6 commented 3 years ago

CheckPPCollision(number x, number y ) This will return a table of bullets that is "touching" at position but with PPCollision Filter to only the bullets that has PixelPerfect Collision.

Why it is needed?: Using AABB Collision will not detect the PPCollision Bullets and it can be useful for custom souls that use more than 1 hitbox to damage the player

Example: Ignore the "black" color. i added it to prevent the github white layout from making it invisible SlopeBullet

bullettest = CreateProjectileAbs("slopebullet",0,0) 
bullettest,ppcollision = true
--This will check if the position 30 0 is considered solid as PixelPerfectCollision system
bulletsAt30 = CheckPPCollision(30,0) 
if #bulletsAt30 == 0 then return 
else DEBUG("Filtered Bullets at position x=0 and y=0") end

Results:

RhenaudTheLukark commented 3 years ago

No. Bullet.isColliding() already exists, you just have to run it on each bullet separately.

Please read the docs before asking for stuff, and for the second time, before creating an issue, talk about your request in the Discord server, you're already there.

I won't repeat myself.