Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

SpineSlotExt

A GameMaker Studio extension allowing the runtime manipulation of slot colour, alpha and collisions on Spine skeletons. · By rIKmAN

Shmup Collision detection

A topic by ndeslol created Oct 18, 2018 Views: 364 Replies: 1
Viewing posts 1 to 2

Hi,

i'm making a Shmup with GMS 1.4 & Spine but collision seems to work pretty bad for some reasons. Most of animations were made with 3.6+ spine and bouding boxes are complexes. (They move along with bones/rotate + they can be toggled on and off at some points of the animation+ animations can have a "large" amount of bounding boxes at a given time). 

I have made some custom collision scripts but they are pretty shitty to setup for each objects (they are not optimal with some animation) because there can be tons of bullets to check collision at a given time in the game.

Does this ext can help me with this ?

Developer (2 edits)

Hi,

It possibly could help, but it depends on your game and what you are trying to achieve.

The extension does not replace the existing GMS collision functions with regards to Spine skeletons, it adds the ability to easily detect one or more slots at a given x/y coordinate (ie. mouse x/y) - this is intended to be used alongside the existing collision functions to give you more options with regards to collision detection.  It's also quite simple to implement in that it's just a single function.

If your bullets are relatively small then you could simply use the x/y coordinate of the bullet with this function and you would be returned a list of all slots found at that x/y coordinate to then deal with as you please.  It would also allow you to easily have enemies with multiple slots that could each take collision independently from each other - for example a boss enemy who's wings you have to shoot off before you can start damaging the body etc.

If you take a look at the Test Tool and load the "spineboy" example, then you can see what I mean.
If you imagine that the mouse cursor was one of your bullets and the spineboy was an enemy in your game you could easily see which bullet hits which body part and take action accordingly - remove health from a specific body part, change a slot to show a damaged image attachment or even change the animation altogether to have an enemy that changes attack patterns when damaged by a certain amount etc.

If your bullets are pretty large however then a single x/y coordinate for collisions wouldn't work very well and you could either try defining multiple points and doing multiple checks per bullet, or you might be better off using the built in GML functions which allow you to do collisions on the whole sprite or as defined by your bounding boxes in Spine.

Hope that helps.