Author Topic: Axe 2048 help?  (Read 15404 times)

0 Members and 1 Guest are viewing this topic.

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: Axe 2048 help?
« Reply #15 on: April 17, 2014, 06:38:54 pm »
I actually tried what ClrDraw said, only my implementation didn't work.

Toctave, I'll do what you said.


EDIT: I did what Toctave said, and all possible test conditions work properly! :D


ThankyouthankyouTHANK you! ;)


Oh, and I saw your game. The only two things I could think to add are animations, and graphics that actually show me what the tiles are. I'm confused; is a dot a 2 or a 4? :/
« Last Edit: April 17, 2014, 09:11:17 pm by JWinslow23 »
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline Toctave

  • LV2 Member (Next: 40)
  • **
  • Posts: 22
  • Rating: +2/-0
    • View Profile
Re: Axe 2048 help?
« Reply #16 on: April 18, 2014, 08:23:22 am »
You're welcome for the help (didn't do much :D). And about my game, you can press 2nd to display the numbers that go with each tile. And I'm working on animations, tho it doesn't work well for now.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Axe 2048 help?
« Reply #17 on: April 18, 2014, 08:28:58 am »
I saw that you didn't want the game to keep its grid intact after you quit and started again the game. That can be easily explained : you're using a part of your program as a buffer (the map), thus you edit on the fly the program's content. That explain what the grid isn't reset each time you launch the game. Fill the buffer with zeroes before editiing it! ;)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe 2048 help?
« Reply #18 on: April 18, 2014, 11:17:16 am »
Or use "external" safe RAM like the one pointed by L1, or L2, etc.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: Axe 2048 help?
« Reply #19 on: April 18, 2014, 01:07:50 pm »
OK, it turns out I forgot to do a small check. My bad. :/


Fix coming soon!
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: Axe 2048 help?
« Reply #20 on: May 01, 2014, 06:22:54 pm »
Bump.

I just wanna say that my port is going along smoothly, and I already have most of the game mechanics coded! :D Here is a screenie:


All I need is a Game Over check, and some sidebar graphics...

Source coming when the Game Over check does!
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe 2048 help?
« Reply #21 on: May 03, 2014, 11:29:29 pm »
Nice so far :D

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe 2048 help?
« Reply #22 on: May 04, 2014, 02:33:29 am »
For the game over check here's a nice algorithm : loop through all the tiles from the bottom left one moving up then right and perform the following checks :
-If the tile is empty, the game's not over. Stop the loop. You could also keep a counter for empty tiles, that would be faster because one less check in the loop which only gets executed if this counter hits 0. Every move would decrease it by 1 for the new random tile and every merge would increment it by 1.
-If not, check the tile to the right and above. If either is the same as the current tile, you can still do something. End the loop here.
-If both checks fail keep going.
-If you are on the last tile and it's not empty you can't make any move => you lost THE GAME.

Hope it helps and yes it looks pretty nice.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe 2048 help?
« Reply #23 on: May 04, 2014, 04:36:03 am »
Or something else you can do to detect a game over is to virtually run a left shift (as if the player pressed the left arrow), a right shift, an up shift and a down shift (of course you do it virtually, you don't show animations and you keep the original board intact) and you check if they are all the same as the original board.
« Last Edit: May 04, 2014, 05:15:45 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe 2048 help?
« Reply #24 on: May 04, 2014, 05:05:11 am »
Yeah that works too. I take it that you meant "you keep the original board intact" though. :P

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe 2048 help?
« Reply #25 on: May 04, 2014, 05:16:20 am »
What do you mean ? That's what I wrote :P
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe 2048 help?
« Reply #26 on: May 04, 2014, 05:31:56 am »
Should have quoted the post before you edited it. :trollface:

Offline TheCoder1998

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 434
  • Rating: +20/-2
  • my art is written in code, not in graphite
    • View Profile
    • My website :D
Re: Axe 2048 help?
« Reply #27 on: May 04, 2014, 05:55:46 am »
this is looking really nice jwinslow :D
keep up the great work!
my ticalc acc:

http://www.ticalc.org/archives/files/authors/113/11365.html

Spoiler For The Best Song Ever:


follow me on tumblr :)
www.rickdepizza.tumblr.com

check out my anilist :D
http://anilist.co/animelist/29701/Rickdepizza

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: Axe 2048 help?
« Reply #28 on: May 05, 2014, 04:50:57 pm »
Streetwalrus and Hayleia, I already have a GAME OVER check (and I still want more :P ). What I did:
  • Check through each tile on the board
  • If every space is occupied
    • 0 -> X
    • For each tile on the board
      • If (one tile to the left=the current tile) or (one tile up=the current tile)
        • Any nonzero value -> X
      • EndIf
    • EndFor
    • If X=0
      • GAME OVER
    • EndIf
  • EndIf
And Hayleia, I actually considered making a move LEFT, then UP, and doing a check as to if any tiles moved. This proved problematic, however. :P

TheCoder, thank you! I have new graphics coming soon (courtesy of Hayleia and me), but in the meantime, enjoy this (not quite so) new screenie of my sidebar graphics and score system:


Download coming within the week!
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe 2048 help?
« Reply #29 on: May 06, 2014, 06:34:42 am »
Looking nice, but IMO the animations are a bit slow >.>

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!