GML mark of the ninja visual queue for sounds

Discussion in 'Programming' started by Matthew Imamura, Jul 10, 2019.

  1. Matthew Imamura

    Matthew Imamura Member

    Joined:
    Jul 10, 2019
    Posts:
    10
    Hi i'm having trouble imitating the ringlike visual queue to represent the sounds. I got the the rings appearing every .5 seconds when running but I cant figure out how to erase them. they just stay there and slowly fill up the map. i was wondering if anyone can help me with that?
     

    Attached Files:

  2. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,433
    Well, we have no idea how you made those rings so can't tell you how to change it. :) Are they instances? Are they being scaled? Are you drawing circles?
     
  3. Matthew Imamura

    Matthew Imamura Member

    Joined:
    Jul 10, 2019
    Posts:
    10
    thank you for replying so fast! I actually just figured out how to do it 1 minute ago. so basically every time the player moves, the obj_ring will be created on the player (since its a ring, it will appear around the player). I solved this by adding an event for the obj_ring. I don't really know how to explain it so here is the code i used. hopefully it can help someone else in need :D .


    create

    image_xscale = 0.1;
    image_yscale = 0.1;



    step

    image_xscale = min(image_xscale + 0.05, 1.2)
    image_yscale = image_xscale;

    if image_xscale == 1.2 instance_destroy(obj_nspdsound)
     
    Last edited: Jul 10, 2019
  4. Matthew Imamura

    Matthew Imamura Member

    Joined:
    Jul 10, 2019
    Posts:
    10
    i'm also new at doing this so I don't really know if its an instance, or if they are being scaled, or if i'm drawing circles. my guess is i'm drawing circles?
     
  5. the_dude_abides

    the_dude_abides Member

    Joined:
    Jun 23, 2016
    Posts:
    629
    It is an object you are creating (the class, or type), and an instance would be when you are referring to a specific individual id of that object. The two have different ways to access them, and the application will have a massively different effect.

    In your code there is an example of where you are not making this distinction:

    Code:
    if image_xscale == 1.2 instance_destroy(obj_nspdsound)
    when you are doing the instance_destroy it will be applied to every instance that is obj_nspdsound, because it is using an object reference. So, even though the code is brought about by the circumstances of the instance running it (image_xscale == 1.2 is a code that uses its own specific details) the end result will be applied to every instance of obj_nspdsound because you aren't using a function related to "self" rather than the object.

    Code:
    if image_xscale == 1.2
    {instance_destroy();}
    would only destroy the instance that has met this condition, rather than every single one that currently exists, as it is applying it to itself
     
    Matthew Imamura likes this.
  6. Matthew Imamura

    Matthew Imamura Member

    Joined:
    Jul 10, 2019
    Posts:
    10
    Thank you for this. I tried it out and it made the animation more smooth. i'm sure I can use this info for more stuff too. :D
     
  7. Matthew Imamura

    Matthew Imamura Member

    Joined:
    Jul 10, 2019
    Posts:
    10
    h
     
    Last edited: Jul 11, 2019

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