Navigation

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

    2048 remake

    Work In Progress
    4
    12
    1971
    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.
    • PB____
      PB____ last edited by PB____

      I created a fully functional remake of 2048 in FUZE4. It's simple text based (nothing fancy, I wrote it in less than a day), but the mechanism works, and it should detect when you win or lose.

      In my original post, I shared my friend code, but I prefer keeping my friend list clean, so I decided to share only a video of the game here for now:

      I heard there is a better solution to sharing your game on it's way (if all goes well), so I'll await that feature to properly share the game with you guys :)

      1 Reply Last reply Reply Quote 4
      • PB____
        PB____ last edited by

        Anybody who would like to play 2048, it's available with code: NXK5N9KB1Z

        1 Reply Last reply Reply Quote 5
        • PB____
          PB____ last edited by

          Some of the controls that may or may not be obvious:

          • Press left or right joycon stick during the game will rotate the background color
          • You can use either the controls, or the touch screen (by swiping in the direction you want to move)
          • You can also use ASDW keys on the keyboard to play the game.
          • The screensaver ball responds a little to the controller velocity, so you can let it fall rapidly by turning your controller 90 degrees
          • If you want to reset the game, press one of the controls on top ( L, R ZL, ZR )
          • In the botton left, you see "{n} score {x}", where {n} is a score based on your moves (same point system as the original 2048 game), and {x} is based on the current value of the tiles.
          1 Reply Last reply Reply Quote 0
          • PB____
            PB____ last edited by

            I felt a little bad for not joining the Game JAM, so I've added a start for an AI to my game in stead. So far it only sometimes reaches 1024, so it's not a good AI at all, but it's just a start... (pending approval)

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

              did a re-upload to fix a little bug (touch input didn't work on buttons anymore).

              The cause was this:
              I had introduced var to declare all my variables at their function scope (so I did some minor refactoring).
              However, I had accidentally used var once too often, causing me to redeclare the same variable within it's function, like so:

              function example()
                  var previousTouch = touch()
                  loop
                      compareTouch(previousTouch, touch())
                      var previousTouch = touch() // using `var` again here: oops
                      update()
                  repeat
              return void
              

              Did some little tweaks to the AI, but it's still stupid (only reaches 1024 some times at best)

              mario.bodemann 1 Reply Last reply Reply Quote 2
              • mario.bodemann
                mario.bodemann F @PB____ last edited by

                @PB____ Hey,

                I didn't know var is a thing!! I got to try it out once back at my switch... Thanks for sharing! ♥️

                pianofire 1 Reply Last reply Reply Quote 1
                • pianofire
                  pianofire Fuze Team @mario.bodemann last edited by

                  @mario-bodemann It isn't really in that it's not an actual keyword but it does seem act like an anonymous type because F4NS is so relaxed about the types of variables. Behind the scenes I think that it is treating it as a struct but one that is undefined. You can put anything before a variable: try wibble!

                  I am going to suggest that var is added to the language

                  1 Reply Last reply Reply Quote 2
                  • PB____
                    PB____ last edited by PB____

                    @mario-bodemann this is fruit of the discussion you can find at https://fuzearena.com/forum/topic/692/instant-karma-on-misplaced-for-loop/6

                    @pianofire that would be nice. I was aware that var isn't an official keyword, but it gives the behavior that I want, and from my discussion with Mike on Discord I understood that I wouldn't need to be afraid about updates breaking this behavior. But having var as an official keyword would be really nice, and more fitting to how Fuze handles types :)

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

                      To keep people updated: I'm still working on this project (though my time is limited of course).

                      What I have done, is integrated the Persistent Data solution by @pianofire into my project, rewrote some of that, to fit my preferences, and using that to store the AI configuration (how much should it weigh if the highest number is in a corner for example).

                      Now I still want to write an algorithm that will systematically try to tune these settings, in order to get a better performing AI.

                      So these are mainly technical changes, so not worth sharing yet. But I thought it's interesting enough to share with you guys what's coming up.

                      Don't expect a high standard solution for AI though. Although I'm a professional software developer, code quality wise my 2048 project is just an experiment. And I never needed to do anything with AI at this level (you wouldn't need to write these type of algorithms yourself for that). My goal for this project is, to end up with an AI that can at least sometimes reach the 2048 tile automatically.

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

                        I've shared an update of my game (also to back-up some progress). For playing the game, the main difference is, that the game now has better menu's, and it has my profile picture as a logo in it.

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

                          This is a great game! Thanks for sharing it, @PB____ !

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

                            Thank you @vinicity. since it was my first project that I created (before the whole showcase gallery came up), I kind of parked this since I wasn't happy with the technical implementation. So it's nice to hear that it still gets appreciated, maybe I should give it an update to just dump the AI idea and properly implement the rest :)

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