Navigation

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

    Would like help with two things

    Help
    4
    4
    211
    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.
    • S
      Sgtelite78 last edited by

      Hi, I have two questions.
      1 - How do I make a radar like in Defender where it shows the player and all the enemies even ones offscreen?

      2 - platform game, I am using map collision to stop a player falling through the ground but the player sinks into the ground by 1-2 pixels which does not look good. What I want to do is have the player dropping down until he is 1 pixel above the ground and stop there. how to do it?

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


        Make a collision box
        setSpritecollisionShape
        (plr, shape_box, 30, 90, 0)

        Plr.show_collision_shape = true

        1 Reply Last reply Reply Quote 1
        • D
          doumdoum F last edited by

          When your player hits the ground, set his vertical position 1 pixel above the area.
          See getMapArea() to retrieve the coordinates.

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

            @Sgtelite78 To answer the radar question, you'll could use draw targets to achieve this. Think of them like separate little screens which you put on screen in an order of your choosing:

            radarScreen = createImage(600, 300, image_rgba) // This creates an image of 600 by 300 pixels, with transparency enabled
            mainScreen = createImage(gwidth(), gheight(), image_rgba) // This is your main screen which will eventually be sent to the frame buffer - width and height are whole screen width/height
            
            //then, in your loop, you would probably want a function which draws everything to the screen.
            loop
                // game code
                draw()
            repeat
            
            function draw()
                setDrawTarget(radarScreen)
                clear()
                // draw enemies and player to this screen scaled down, or as "dots" - in defender style
                
                setDrawTarget(mainScreen)
                clear()
                drawImage(radarScreen, gwidth()/2 - 600, 0) // draw the radar to your main screen image
                // the rest of your drawing, enemies, player, etc. These could also be in their own draw targets for total control
                
                // finally, draw your main screen to the frame buffer
                setDrawTarget(frameBuffer)
                drawImage(mainScreen, 0, 0)
                update()
            return void
            

            I've put a clear() command after each setDrawTarget() because it's a catch all for problems you might face without them. Sometimes it's not necessary, but it's safe to assume you'll need them.

            The "Ninja Scroll" game uses separate draw targets and compiles them into an image in a similar way I've listed here, if you wanted an example. It doesn't do anything like a radar display, however.

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