Navigation

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

    I can’t get my sprite character to show up in my game?

    Help
    5
    8
    511
    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.
    • Codemaster201 0
      Codemaster201 0 last edited by

      90CD46AD-0B00-473D-834A-1C8E2F2F6CB3.jpeg B61964E5-0CAE-41ED-834F-75647AC7C68F.jpeg

      What am I missing here?

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

        I see a sneaky repeat up on line 12. Unless it's for a special loop (a for loop or while loop) or a normal loop with a break in, your program will get stuck in there and never reach any of the lines below. If that's the case, you'll want to take out the first loop and put everything you need into the second one.

        If you haven't already, I recommend going through the tutorials in the help section and/or checking out Dave's coding shorts and video tutorials on YouTube/TikTok! They're super helpful
        (https://www.youtube.com/@FUZEArena , https://www.tiktok.com/@fuze_arena )

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

          Make sure your variable names don't have spaces in them!

          // A space inbetween young and lady will mean FUZE gets confused and will give you an error.
          young ladyx = gwidth()/2
          
          // it should be like this:
          youngladyx = gwidth()/2
          

          I would also say that you might want to go for smaller variables names - if just "lady" will do, then you might aswell drop the "young" part - it'll make typing easier in the long run!

          Also it seems you are trying to use the sprite properties with the statements like youngladyx and youndladyxscale etc.. What you have there are just individual variables - they won't affect the sprite unless you use those variables in a function like setSpriteScale().

          What I think you want is the dot access, to use the sprite properties instead. Try this:

          // Program setup
          
          backgroundImage = loadImage("Selavi Games/bedroom")
          backgroundScale = gheight() / imageSize(backgroundImage).y // This gives us a scale multiplier to fit the image perfectly on screen
          
          youngLadySpritesheet = loadImage("Pixelsnplpay/Young lady")
          youngLady = createsprite()
          setSpriteImage(youngLady, youngLadySpritesheet)
          
          // When using sprite properties, you must use the dot (.) to access their properties, like .x or .y:
          youngLady.x = 0 // When using sprites, (0, 0) is the centre of the screen. Sprites behave differently to other drawing functions like drawImage()
          youngLady.y = 0
          youngLady.xscale = 10 // This might be a bit too big, try a smaller number first.
          youngLady.yscale = 10
          
          // Main Loop - remember, once we are in an infinite loop like this, the program will stay here.
          loop
              clear()
              drawImage(background, 0, 0, backgroundScale)
              drawSprites()
              update()
          repeat
          

          This should put your sprite in the middle of the screen, appearing over the background as you want.

          Making a full game is quite a challenge, and it might be something you should work towards slowly! Make sure you understand the basic concepts well before trying a full game project. The tutorials will help you!

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

            Another thought.. Take a good read of the Sprite System document in the FUZE4 Help pages!

            Codemaster201 0 1 Reply Last reply Reply Quote 1
            • Codemaster201 0
              Codemaster201 0 @Dave last edited by

              @dave I would but the print is too small for me on my switch. I just need characters on screen to be Able have a conversation and have one give the medicine.that’s the just of my program.

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

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • M
                  Maxwello F last edited by

                  The help that you can access via the drop down box on this forum has a lot on it too and can be viewed on whatever device you are viewing this. Good luck buddy

                  1 Reply Last reply Reply Quote 0
                  • HeyoMayo
                    HeyoMayo F last edited by

                    You appear you have a loop before the loop where the sprite gets drawn, if the above loop blocks that loop then the sprite will never be drawn

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