Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    How do I check if an id of an instance of an object is two pixels below charcter in Fuze?

    Coding
    2
    3
    239
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Miami Heat Lover last edited by

      GML stands for Game Maker Language

      Here is a GML example
      [code]
      if (place_meeting(x,y+2,Carla)) //checks if a Carla is two pixels below
      {
      i = instance_place(x,y+2,Carla); //i is equal to a specific Carla that is two pixels below
      var_hp = 12; //variable var_hp = 12;
      }
      }
      [/code]
      ^ how do I change up above code to work in Fuze please? Thank you so very extremely super much in advance.

      1 Reply Last reply Reply Quote 0
      • PB____
        PB____ last edited by PB____

        I don't know GML, but you can use three `-symbols before and after your code to display it as code, to keep formatting. Like so:

        if place_meeting(x, y+2, Carla) then
            i = instance_place(x, y+2, Carla)
            hp = 12
        endif
        

        Fuze doesn't have any Carla, but you can create your own data structures and functions:

        carlas = [
          [.x = 1, .y = 2, .name = "Carla Senior", .description = "Doesn't get the credit she deserves"],
          [.x = 7, .y = 10, .name = "Carla Junior", .description = "She has a crush on you"],
          [.x = 7, .y = 5, .name = "Clara 5", .description = "What's this cow doing here? She's not a carla!"]
        ]
        function place_meeting(x, y, carla)
            var found = carla.x == x and carla.y == y
        return found
        
        // tries to find a clara at the provided location, if not found, return Clara 5 in stead.
        function instance_place(x, y)
            var found
            var i
            for i = 0 to len(carlas) loop
                found = carlas[i]
                if place_meeting(x, y, found) then
                    break
                endif
            repeat
        return found
        

        Like I said, I don't know GML so this example code might not do what you tried to do. But it can give an impression about how Fuze works for you.

        1 Reply Last reply Reply Quote 0
        • M
          Miami Heat Lover last edited by

          Thank you

          (note from Kat- posts must contain at least 12 characters)

          1 Reply Last reply Reply Quote 1
          • First post
            Last post