[2D Game]how I get the sprite ID inside a screen ?

Advanced game related topics
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 627
Joined: Fri Dec 04, 2015 9:26 pm

[2D Game]how I get the sprite ID inside a screen ?

Post by skinkairewalker »

how I get the sprite identifier inside a screen which the mouse clicked on , or collision between sprites ?
User avatar
Derren
Enthusiast
Enthusiast
Posts: 313
Joined: Sat Jul 23, 2011 1:13 am
Location: Germany

Re: [2D Game]how I get the sprite ID inside a screen ?

Post by Derren »

SpriteCollision()
SpritePixelCollision()

For the mouse, display an invisible Sprite at the cursor and use SpriteCollision().

You need to loop through all the sprites and check for collisions. More than two sprites can have a collision if they overlap.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 627
Joined: Fri Dec 04, 2015 9:26 pm

Re: [2D Game]how I get the sprite ID inside a screen ?

Post by skinkairewalker »

thanks :D
Post Reply