Suggested by Karolis Poviliūnas and John Benson Through the same menu, you can also change the scaling and rotation of the instance, and set a unique ID so that you can access that particular instance through code. This way, you can assign different HPs to different instances, inside their creation code.
Gamemaker 7 kety code#
When you place instances inside a room using the Room Editor, you can right click on them and open the “Creation Code” window (or in GMS2, double-click) and type code in it.
As a beginner, your first instinct might be to create another object and change the HP inside it. Say you want to have two enemies, one with 4 HP and the other with 10. #3: Different values for different instances So before copying code over to your project, make sure you at least try to understand how it works. Even if you do use code from a tutorial, do not attempt to modify it or expand upon it unless you understand how it works. If you’re serious about something, code it yourself.
Tutorials exist as a guide so that you can understand how things work. You might think that it’d be a good idea to use a tutorial to build a game/system, but it’s not. In a project, you can’t have complete control over your workings if you don’t understand how any part of your code works. While that appears to be fine, it’s only going to increase the trouble. Sometimes you just want to make something work, so you copy over some code from a tutorial, even if you don’t understand how it works. #2: Don’t copy-paste code without understanding Here are some tips which should help beginners do some things right and know what they might be doing wrong.īefore Googling something or asking someone about an issue, make sure to check the relevant entry in the documentation – it may contain information that might help you solve your problem.