Navigation

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

    New marked map area functions

    Coding
    3
    12
    621
    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.
    • pianofire
      pianofire Fuze Team @waldron last edited by

      @waldron Sorry I don't understand the question

      waldron 1 Reply Last reply Reply Quote 0
      • waldron
        waldron F @pianofire last edited by

        @pianofire sorry, say if i only want a characters state to action in certain areas.
        so in my case i have a ladder so i press up to climb it but i dont want to be able to press up and enter the state anywhere only in those areas?

        1 Reply Last reply Reply Quote 0
        • pianofire
          pianofire Fuze Team last edited by pianofire

          So if you mark your ladder collision boxes as Ladder1, Ladder2 etc you could do something like this:

          if detectMapAreaCollision( areaName, sprite ) then
              canClimb = strBeginsWith(areaName, "Ladder") 
          

          and then:

          if (canClimb and c.y) then
              // move sprite up
          
          Dave waldron 3 Replies Last reply Reply Quote 3
          • waldron
            waldron F last edited by

            wonderful thank you i presume i can access a lot of actions with this including getting text and sounds to play in certain areas this should keep me busy for a while

            1 Reply Last reply Reply Quote 1
            • Dave
              Dave Fuze Team @pianofire last edited by

              @pianofire That is awesome.

              1 Reply Last reply Reply Quote 0
              • waldron
                waldron F @pianofire last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • waldron
                  waldron F @pianofire last edited by

                  @pianofire i must be doing something wrong am i missing anything? variable?

                  waldron 1 Reply Last reply Reply Quote 0
                  • waldron
                    waldron F @waldron last edited by

                    @waldron said in New marked map area functions:

                    @pianofire i must be doing something wrong am i missing anything? variable?

                    OK I was missing the area name variable but still not working.

                    1 Reply Last reply Reply Quote 0
                    • pianofire
                      pianofire Fuze Team last edited by

                      @waldron sorry it was only a code snippet. Have a look at the checkCollisions function in the post at the top

                      areaNames = getMapAreaNames()
                          for i = 0 to len(areaNames) loop
                              areaName = areaNames[i]
                              area = getMapArea( areaName )
                              if detectMapAreaCollision( areaName, sprite ) then
                      
                      waldron 1 Reply Last reply Reply Quote 2
                      • waldron
                        waldron F @pianofire last edited by

                        @pianofire I added that part still no joy il wait till iv got a bit more time on my hands maybe missing something silly

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