best practice

  1. Coded Games

    GMS 2 Optimizing Collisions

    So I have been working on optimizing my game today and noticed that the largest portion of runtime is the Engine's HandleCollision category (around 40% of total runtime). It make sense, as my game is a bullet hell it can have up to thousands of bullet instances at a time. I have tried being...
  2. MartinK12

    GML [SOLVED] General question - Should I split code between step and draw event?

    Many times I have to change variables and sprites according to some other variable. In example: if clicked { var1 = 1; var2 = 2; draw_sprite... image_index... image_speed.. } Should I split this into step and draw event like below so check clicked both in step and draw event? In step event: if...
  3. Guitarmike

    Single-instance objects referenced by global variables

    Hi, I'm new to GML but not to programming. I'd like a little advice on best practices. I have a couple of objects in my game for which there is only a single instance and which need to be accessible from many other places around the game. For example, the obj_player and the obj_clock...
  4. Erayd

    Windows Testing

    I'm looking for input on testing. I am wondering if there are any built in programs in GMS2 that do things like check if a variable is used in the right way. For example: if it is being set at run time but never changed. Then somewhere in the program that variable is being reset, which would be...
  5. P

    efficient collisions...all on player or on each enemy?

    Hi all, For game efficiency, is it best practice to code all the 'kill player' collisions on the player for each enemy OR on each enemy for the player? *given there are more enemies on screen than players e.g: player > collision > enemy1 player > collision > enemy2 player > collision > enemy3...
  6. D

    GMS 2 Script Based Index vs Global Instance Based Index - Quiestion

    Hey guys, I'm working on a project item system and I was hoping for a bit of guidence regaruding the best practice to storing large amounts of data. The set-up is this: I have numour item within my game, lets say 100 for now. Each of though items holds 10 variables with different values. I have...
  7. T

    GMS 2 Sprite draw vs instance memory(collision)

    Hey guys, I'm working on a game where the player can equip/holster guns, this places the instance on the player's back. Problem is it collides with the player 100% of the time. When i try to pickup guns from the floor the collision is picking up the gun on my back first. I have a few options...
Top