Navigation

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

    Fruit Machine - problems!!

    Work In Progress
    5
    22
    644
    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.
    • SwitchedOn
      SwitchedOn last edited by

      So I wanted to take a (very short!) break from my hex game and try to expand on my Fuze knowledge. Just a small project I could practice using functions on etc, so thought a nice simple fruit machine project would be good.

      Already run into so many issues! So heres what I've got so far;

      image.jpg

      Not particularly exciting :)

      So the issues are;

      • The output to get the symbols onto the screen is actually running through a multidimensional array reels[0-3] and then symbols [0-20]. The output is only showing 1 of the reels though

      • I suspect this is because is used the same sprite call for every symbol on each reel like this;

      image.jpg

      So i wonder if even though I'm trying to have for example symbols[reel1][symbol1]=appleSpr and the same for reel/symbol 1 and 2, whether as its pointing to the same sprite, its not possible to have that duplicated 3 times.

      • BTW, in that loop, I'm trying to space out the fruit to the reels using spriteLocation and then adding a value to X during each reel loop, which means they should be appearing on each reel. I dont think all 3 reels are stacked up in the screen shot...

      • Even if I could get that working, the next issue I've throught of is how to first randomly position the reel, so the middle line is a random symbol from the 20 on the reel - which obviously then leads on how to spin them, though I have a little idea about that.

      ===========

      So there it is - a supposed "easy" project and I'm pretty disappointed (in myself) that I cant figure it out better than I have. I dont want to spend too much time on this and may from time to time just take on a 1 hour project to practice inbetween my strategy game - but I did think it was worth creating this post as I'm sure others have thought of doing a Fruit Machine, so maybe this could be somewhere the logic for one could be discussed?

      Paul

      1 Reply Last reply Reply Quote 4
      • SteveZX81
        SteveZX81 F last edited by

        Now you see why I chickened out from making one. ;)

        1 Reply Last reply Reply Quote 0
        • mario.bodemann
          mario.bodemann F last edited by

          Hey,

          I think you are right, assigning all the reels like this will make all the reels point to the same sprite.

          Instead of using the handle (cherrySpr) you'd need to do create a new handle for every symbol on every reel. So whatever you did to create cherrySpr needs to happen inside the loop. Maybe a own function for creating those sprites/symbols can be helpful.

          For drawing afterwards, you'd need to hide and show the sprites depending on whether they are one of the three to be shown or not...

          Greetings, Mario

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

            I made one of these once ( using a Dev kit which shall remain nameless) . My approach was to make images of the reels then move them up as they span. When a reel's image gets to the top it goes back to the bottom. The height of the reel can be controlled by an angle variable so that setting a random start position is simply a matter of setting random start angles.
            Let me know if you'd like a clearer explanation. I was thinking of trying my hand at one of these myself.

            1 Reply Last reply Reply Quote 1
            • SwitchedOn
              SwitchedOn last edited by

              Thank @mario-bodemann and @DomDom both good ideas. I’ll definitely be back with an update and probably more questions!

              @MikeDX also had a good solution on discord which I need to read a few times as may be above my understanding!

              1 Reply Last reply Reply Quote 1
              • DomDom
                DomDom F last edited by

                Here is a closeup picture of my attempt at this 15830921349467809094037728508574.jpg

                1 Reply Last reply Reply Quote 3
                • DomDom
                  DomDom F last edited by

                  By the way, did you draw the fruits yourself? I could not find any in the media vault.

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

                    Nice @DomDom !! I got it 'working' (not done much more since) but having an array of symbols. So AppleSpr[0], [1] etc. Not the most efficient way, but thats the great thing about coding, lots of ways to do things.

                    yea, the symbols took some finding, but I settled on "Ravenmore/platformPickups".

                    Some really nice graphics generally there too.

                    DomDom 1 Reply Last reply Reply Quote 1
                    • SteveZX81
                      SteveZX81 F last edited by

                      DomDom that is pretty awesome looking!

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

                        Thanks Steve. All for less than 100 lines of code. I will try to get around to commenting it then I will share it.

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

                          @SwitchedOn That's better! Thanks.
                          15831306107181700648294909311775.jpg

                          1 Reply Last reply Reply Quote 3
                          • SwitchedOn
                            SwitchedOn last edited by

                            That looks superb @DomDom - how on earth have you got the 'curved' effect on the reels? That looks so cool.

                            I feel a bit silly for trying it myself now as I'd not be able to do what you've done here :(

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

                              Basically it involves using drawquad() with a dash sin()
                              I''ll post some kind of explanation soon but first want to refine one step in the process

                              SwitchedOn 1 Reply Last reply Reply Quote 2
                              • SwitchedOn
                                SwitchedOn @DomDom last edited by

                                @DomDom

                                @SwitchedOn said in Fruit Machine - problems!!:

                                That looks superb @DomDom - how on earth have you got the 'curved' effect on the reels? That looks so cool.

                                I feel a bit silly for trying it myself now as I'd not be able to do what you've done here :(

                                My word, it looks incredibly good. I get frustrated as I wouldn't even THINK of doing that, let alone knowing how too. I'd love to see the finished code if you wouldn't mind.

                                1 Reply Last reply Reply Quote 1
                                • DomDom
                                  DomDom F last edited by

                                  Don't sell yourself short man. As I said, I've done this before. The first version started off looking a lot like yours. It wasn't until the basic version was up and running that the ideas for tweaks (and how to go about implementing them) started to arise. I expect you would have had much the same experience.
                                  I'll post the code when it has been commented.

                                  1 Reply Last reply Reply Quote 2
                                  • DomDom
                                    DomDom F last edited by DomDom

                                    FF633MND1U.

                                    I haven't explained everything but I'm sure you'll get the gist

                                    SwitchedOn 1 Reply Last reply Reply Quote 1
                                    • DomDom
                                      DomDom F last edited by

                                      1 Reply Last reply Reply Quote 2
                                      • SwitchedOn
                                        SwitchedOn @DomDom last edited by

                                        @DomDom said in Fruit Machine - problems!!:

                                        FF633MND1U.

                                        I haven't explained everything but I'm sure you'll get the gist

                                        Thank you! Says "project not found" so probably not been put live yet?

                                        But appreciate it thanks, looking forward to checking it out.

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

                                          It has just been approved

                                          1 Reply Last reply Reply Quote 1
                                          • SwitchedOn
                                            SwitchedOn last edited by

                                            thanks @pianofire

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