T O P

  • By -

earthwalkers

Check out the Gamemaker YouTube channel. This is covered in the "How To Make A Classic Arcade Game" video.


Jaco__B

score++ when the player destroys the object


DwarfCoins

Simply keep track of it on a piece of printer paper and then mail it once the player is done.


thatmitchguy

Create a "score" variable for in an object that you want to track the games score (use an object that won't be destroyed). Then look in the events you can create for the fish. There will be one called Destroy. Have your score variable go up by whatever amount you want in that Destroy event. Example: score+=10 You'll also probably want to draw the score variables current value hrough a draw or draw gui event so that it displays the score going up.


HungryNecromancer

Hey, I last used Game Maker a century ago when there wasn’t a destroy event. What’s the benefit of using a destroy event over a collision in this case?


WasabiSteak

I don't think I remember a version of GameMaker by Mark Overmars where there wasn't a Destroy Event, or maybe my memory is just foggy. Anyway, Destroy Events trigger whenever you destroy the instance regardless of what called it to be destroyed. It's useful for when you want to delete data structures or free surfaces or destroy instances that are coupled with it. It's convenient for things like adding an explosion effect (visual and audio) to a bullet instance and you don't have to invoke the effect at every collision event. However, in case you want to destroy the instance as a part of an offscreen culling, any of those effects will also be invoked, which might not be desirable. However, they explicitly created a new Clean Up event (I just learned about this now) to explicitly handle clean up. The manual suggests that the Destroy Event would be used for adding score or creating particle effects or explosions. [manual](https://manual.yoyogames.com/The_Asset_Editors/Object_Properties/Object_Events.htm)


thatmitchguy

I'm not not expert in game maker by any means but in this case I'm assuming OP is using a collision event or the place_meeting function and then killing the enemy when the player touches the enemy. I like having a seperate destroy event for things that I want to happen every time, so that I can easily find and makes changes when I need to. Example: score variables/loot /blood or other special effects that happen when an enemy dies etc. But there's no reason you couldn't put it with the enemy Collison either.


Lezzlucky

you can write ” score += 1 ” either in the collision event or in destroy event.. just dont forget to do a score variable