I skipped using sprite origin because I didn’t feel like bothering with counting pixels and setting each sprite origin differently. Then once all the subimages were created, I removed each subimage into its own sprite, and set the collision mask to cover just the pixels in the imageĪs you can see, this approach results in a lot of “wasted” space in the sprite sheet in the form of transparent pixels, but if you’re concerned about this, you could always achieve the same effect by using sprite origin and sprite offset to position the images without all the whitespace in the sprite sheet. I then took the image I wanted to use for the sprite, and cut out all the different clickable regions, putting each into its own subimage by itself. Then there are 6 objects for the 6 switches on the console. I accomplished this with a few simple techniques that work really well: This enables each switch to have its own collision detection and mouse events. If you look at the Atari 2600 console in this game, it is actually multiple objects, made to look like a single object. The project has a TON of extraneous code in it, some of which is pretty messy, so I’ll replace the download link with a cleaner example project of just this technique in coming days. I used this technique in my recent Ludum Dare game, Ancient Technologies. How to make an object that handles multiple collision zones by using multiple sub-objects Tutorial: GM Version: GameMaker:Studio 1.4 (concept should work in earlier versions)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |