Navigation

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

    Have the screen follow the player

    Beginners
    screen sprite movement
    2
    3
    330
    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.
    • P
      PAUM3000 last edited by PAUM3000

      I saw a post on this last night, but now I can't find it to try the solutions offered. Anyway, I have no idea how to make the screen follow.

      I remember something about player.x and player.y, but do I have to set up a structure for that? Is player a variable already?

      Thanks. Also, it's very hard for me to figure out how to figure out the code I need to use without step by step instructions. I feel like I should know a lot of this from memory and it makes me want to give up. Any encouragement or direction would be helpful

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

        @paum3000 I'm pretty sure this is covered in the tutorials (sprite's) but to give you a fast tracked answer it's all to do with the
        Setspritecamera()

        setspritecamera(player.x,player.y,1 )
        As long as that's in your main loop it will constantly update and follow the player.

        Loop
        Clear()
        Setspritecamera(player.x,player.y,1)

        Update()
        Repeat

        Strongly urge you to read through the sprite commands they can be a bit tricky to find in the help section.
        But of course it's always good to ask we are all happy to help.

        1 Reply Last reply Reply Quote 1
        • P
          PAUM3000 last edited by

          That worked thank you! One problem I was having is that I didn't set the sprite to "player" but instead "elf".

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