1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GM:S 1.4 Object Orientation in GMStudio

Discussion in 'Tutorials' started by GMWolf, Oct 30, 2016.

  1. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,464
    frumple, makas, ThunkGames and 2 others like this.
  2. Zerb Games

    Zerb Games Member

    Joined:
    Jun 27, 2016
    Posts:
    259
    Awesome concepts! I Composition over Inheritance is something that is incredibly useful. Haven't watched the video yet, but given the description alone I think this is great!
     
    GMWolf likes this.
  3. makas

    makas Member

    Joined:
    Oct 15, 2016
    Posts:
    226
    love your tutorials man!!
     
    GMWolf likes this.
  4. xleonhart

    xleonhart Guest

    Nice video.
    I have something to add:
    In the composition part, its valid to note that you don't need to instantiate an object to use their events. You can use event_perform_object, to perform , for example, the gun step event and this way you can have more control of where/when the gun code will be executed.
     
  5. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,464
    That is true. Sort of using object statically. But you do loose a lot of flexibility with instance variables, and you could just assign a set of scripts.

    But indeed, it is something to keep in mind when designing systems.
     
    Lonewolff likes this.
  6. ECEngineering

    ECEngineering Member

    Joined:
    Oct 14, 2016
    Posts:
    7
    If you want to create a lot of instances of an object this way, it is much better to deactivate them ones created as you can also access variables of the deactivated instance.
    I've used "instance_create" and instance activate/deactivate functions to write "delete" and "new" scripts which can be used to do some really useful stuff like creating custom data structures.
    I hope you find it useful: https://forum.yoyogames.com/index.php?threads/creating-custom-data-structures-with-simple-oop.29252/
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice