Navigation

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

    Draw a random image

    Coding
    2
    4
    416
    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.
    • poof92
      poof92 last edited by

      I have two monsters images and every time an encounter happens I would like to randomly draw one of the monsters

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

        if there on the same sprite sheet you could set the drawsheet with the tile number using a variable monster = 0 drawsheet(monsterimages,monster,0,0,1).
        then whenever you change the monster variable the image would switch.
        if there on different image files you could just use
        if monster ==1 then
        drawsheet(monsterimage1,0,0,0,1)
        endif
        if monster == 2 then
        drawsheet(monsterimage2,0,0,0,1)
        endif
        Using monster = 0 as a false so nothing is drawn.

        If your using sprites same principle but your using setspriteanimation
        and if a separate image file then you would need to setspriteimage as well as the animation.

        poof92 1 Reply Last reply Reply Quote 1
        • poof92
          poof92 @waldron last edited by

          @waldron Thank you I will give it a try!

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

            It works thanks for the help!

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