Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Toctave

Pages: [1] 2
1
Axe / Re: [Axe game] 2048
« on: April 20, 2014, 03:24:07 pm »
OK thanks guys this is great
Runer, I can't redraw thé whole board on top of it because I need every celle that moves to be displayed on the buffer before the unique Dispgraph (unique in the big for loop I mean)

About the /8, it's not needed because the pos and target values are not in pixels but in values from 0 to 15. If you open xls you'll sée that this calculus returns the right value

Hayleia, I will do what you said about the variable, but I don't think your second idea really brings anything to the program. However I'm the newbie here :D

Edit : Here's an xls file (That no one will read) that does every calculus using only a pos and target value.

2
Axe / Re: [Axe game] 2048
« on: April 20, 2014, 12:00:07 pm »
This thread...
SO! Can anyone tell me why the code I wrote above doesn't work? 'Cause here's an excel with exemples value that returns the Good numbers, I have no idea why it won't work on calc...

3
Axe / Re: [Axe game] 2048
« on: April 20, 2014, 06:48:54 am »
Oh dang, ok. I didn't read it that way, thought he offered to add animations in his own game which I found weird. Anyway, I tried to implement animations this way :
-each time there is movement, store the evaluated cell address, the sprite index and the target cell address in a list
-make a for loop with the animation frame as an incrementing variable :
(for left-right movement here)


For(frame, 0, 7)
Check if there's something in the sprite, then
Pt-Off((target-pos)*frame+(pos^4*9+31), pos/4*9+21, sprite)
Pt-On((target-pos)*(frame+1)+(pos*9+31), pos/4*9+21, sprite)
End


Which gives with proper axe syntax :


Code: [Select]
For(J,0,7)
For(I,0,15)
If {I*3+L2}!=0
Pt-Off({I*3+2+L2}-{I*3+1+L2}*J+({I*3+1+L2}^4*9+31),{I*3+1+L2}/4*9+21,{I*3+L2}+Pic0)
Pt-On({I*3+2+L2}-{I*3+1+L2}*(J+1)+({I*3+1+L2}^4*9+31),{I*3+1+L2}/4*9+21,{I*3+L2}+Pic0)
End
End
End

But it doesn't work at all and gives weird results :(

4
Axe / Re: [Axe game] 2048
« on: April 20, 2014, 02:35:23 am »
Excuse me guys but would you care discussing this on your own thread since it's kind of unrelated to mine..

5
Axe / Re: Axe 2048 help?
« 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.

6
Axe / Re: Axe 2048 help?
« on: April 17, 2014, 02:38:40 am »
Hi!
I don't have enough time now to help you (I'll come back this afternoon) but you should check my topic about the 2048 I made, in the first post there's explanation about that (making it so that 8-4-4-0 changes to 0-0-8-8 and not 0-0-0-16). Basically you should have a variable pointing to the position before the last merge, where the blocks should stop.


Btw I can't really understand how your code works, could you add comments to it?

7
Axe / Re: [Axe game] 2048
« on: April 15, 2014, 01:50:43 pm »
Everything's feasible!
but erm... I have no idea how to do that.I would need to check if a block has moved and from where to where, then in a for loop make all the moves... I can't think of another way, and this one would be quite complicated to put up.

8
Axe / Re: [Axe game] 2048
« on: April 15, 2014, 01:41:04 pm »
Thanks! I thought numbers would be either unreadable or would take the whole screen so I went for this style, allowing to have regular tile sizes. Any new feature ideas?

9
Axe / Re: [Axe game] 2048
« on: April 15, 2014, 12:52:39 pm »
oops I totally forgot that :x
Here you go!
Don't hesitate to tell me if you see a bug/find the graphics horrible/have an idea for a new feature!

10
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 03:07:46 pm »
HI AGAIN GUYS!
(sorry my happiness is exploding)
So the game's all done, thanks to pikachu and the walrus for the help. Here's a gif of how it works :

and here's the code :




Code: [Select]
.A2048
[FF818181818181FF]->Pic0
[FF818199998181FF]
[FF8189B99D9181FF]
[FF81FF8181FF81FF]
[FF81BDA5A5BD81FF]
[FFA5FFA5A5FFA5FF]
[FF9999FFFF9999FF]
[FFC3A59999A5C3FF]
[FFC3BDBDBDBDC3FF]
[FFFFC3DBDBC3FFFF]
[FFFFFFE7E7FFFFFF]
[FFABD5ABD5ABD5FF]
[FFFFFFFFFFFFFFFF]
DeltaList(40,16)->Pic1
[FFFFF0FF00818190818081819F8180F999999980F999999980819981818081998181809F99F999809F99F9998081818981808181898180FFFF8FFF807FFF87FF80000000000000000000000000000000]


DiagnosticOff
ExprOn
Full
Fix 5
Fill(L1,16,0)
0->I->J->K
1->{L1+16}


UnArchive "|vA"
!If GetCalc("|vA"
GetCalc("|vA",20)->Q
R()
Else
GetCalc("|vA")->Q
End
LOAD()
GUI()


Repeat getKey(15)
If getKey
If getKey(1)
DOWN()
End
If getKey(2)
LEFT()
End
If getKey(3)
RIGHT()
End
If getKey(4)
UP()
End
If getKey(55)
R()
End
If getKey(54)
H()
End
GO()
If S>{Q+18}^^r
S->{Q+18}^^r
End
If S!=W
TEXT()
S->W
End
End
D()
End
SAVE()
ClrDraw^^r^^r
Return




Lbl DOWN
0->theta
For(J,0,3)
3->N
For(K,1,3)
3-K->I+1->X
If {4*I+J+L1}->V!=0
Repeat {4*X+J+L1}->T=V or (T!=V and (T!=0)) or (X=N)
X++
End
{4*X+J+L1}->T
If T!=V and (T!=0)
X--
End
If X!=I
If {4*X+J+L1}=0
V->{4*X+J+L1}
Else
V+1->{4*X+J+L1}
X-1->N
e^(V+1)+S->S
End
0->{4*I+J+L1}
theta++
End
End
End
End
If theta
N()
End
Return


Lbl LEFT
0->theta
For(J,0,3)
0->N
For(I,1,3)
If {4*J+I+L1}->V!=0
I-1->X
Repeat {4*J+X+L1}->T=V or (T!=V and (T!=0)) or (X=N)
X--
End
{4*J+X+L1}->T
If T!=V and (T!=0)
X++
End
If X!=I
If {4*J+X+L1}=0
V->{4*J+X+L1}
Else
V+1->{4*J+X+L1}
X+1->N
e^(V+1)+S->S
End
0->{4*J+I+L1}
theta++
End
End
End
End
If theta
N()
End
Return


Lbl RIGHT
0->theta
For(J,0,3)
3->N
For(K,1,3)
3-K->I+1->X
If {4*J+I+L1}->V!=0
Repeat {4*J+X+L1}->T=V or (T!=V and (T!=0)) or (X=N)
X++
End
If (T!=V and (T!=0))
X--
End
If X!=I
If {4*J+X+L1}=0
V->{4*J+X+L1}
Else
X-1->N
V+1->{4*J+X+L1}
e^(V+1)+S->S
End
0->{4*J+I+L1}
theta++
End
End
End
End
If theta
N()
End
Return


Lbl UP
0->theta
For(J,0,3)
0->N
For(I,1,3)
I-1->X
If {4*I+J+L1}->V!=0
Repeat {4*X+J+L1}->T=V or (T!=V and (T!=0)) or (X=N)
X--
End
{4*X+J+L1}->T
If T!=V and (T!=0)
X++
End
If X!=I
If {4*X+J+L1}=0
V->{4*X+J+L1}
Else
X+1->N
V+1->{4*X+J+L1}
e^(V+1)+S->S
End
0->{4*I+J+L1}
theta++
End
End
End
End
If theta
N()
End
Return


Lbl SAVE
conj(L1,Q,16)
S->{Q+16}^^r
Return


Lbl LOAD
conj(Q,L1,16)
{Q+16}^^r->S
Return


Lbl N
16->L
Repeat {L1+L}=0
rand^16->L
End
rand^6/5+1->{L1+L}
Return


Lbl R
0->S->W
Fill(L1,16,0
N()
N()
Return


Lbl GO
0->H
For(I,0,15)
If {I+L1}=0 or (I<12 and ({I+4+L1}={I+L1})) or (I^4!=3 and ({I+1+L1}={I+L1}))
1->H
End
End
!If H
Pause 300
ClrDraw^^r^^r
If S={Q+18}^^r
RECT(20,17,56,30,~1)
Text(30,20,"Game Over!")
Text(28,28,"Score:",S>Dec)
Text(23,36,"New Highscore!")
Else
RECT(24,21,47,21,~1)
Text(29,24,"Game Over!"
Text(27,32,"Score:",S>Dec)
End
DispGraph
Repeat getKey
End
R()
GUI()
End
Return


Lbl H
ClrDraw^^r^^r
For(I,0,11)
Pt-On(I/6*48+20,I^6*9+5,I+1*8+Pic0)
If I<6
Text(29,I*9+6,e^(I+1)>Dec)
End
End
Text(56,6,"128")
Text(56,15,"256")
Text(56,24,"512")
Text(52,33,"1024")
Text(52,42,"2048")
Text(52,51,"4096")
Text(58,58,"by Toctave"
DispGraph
Repeat getKey
End
GUI()
Return


Lbl RECT
HLine({r2},{r1}-{r5},{r1}+{r3}+{r5}
HLine({r2}+{r4},{r1}-{r5},{r1}+{r3}+{r5}
VLine({r1},{r2}-{r5},{r2}+{r4}+{r5}
VLine({r1}+{r3},{r2}-{r5},{r2}+{r4}+{r5}
Return


Lbl GUI
ClrDraw^^r^^r
Tangent(32,3,Pic1
For(I,0,15)
Pt-On(I^4*9+31,I/4*9+21,Pic0)^^r
End
RECT(29,19,38,38,1
RECT(70,21,24,14,~1
RECT(70,38,24,14,~1
TEXT()
Return


Lbl D
For(I,0,15)
If {L1+I}
Pt-On(I^4*9+31,I/4*9+21,{L1+I}*8+Pic0)
End
End


DispGraph^^r
Wref(31,21,35,35)
Return


Lbl TEXT
Text(72,22,"Score:"
Text(73,28,S>Dec
Text(75,39,"Best:"
Text(73,45,{Q+18}^^r>Dec
VLine(94,45,50)
VLine(94,28,33)
Return

Fix 4
What I changed :
-The GUI doesn't update every loop anymore, it now has its own subroutine GUI()
-Same for text, it only updates when needed with TEXT()
-Game Over is now supported, whenever you're stuck, the game stops and displays a window with your score and highscore if you beat it, then waits for any key and resets, it's subroutine GO()
-Every display bug is fixed, the text does not flash like an epileptic mouse anymore

11
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 11:20:43 am »
Except ones from the bottom row and right column shouldn't check their right/bottom. Gotta write program that down.


12
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 11:17:09 am »
Well if every block checks his bottom and left every bound will be checked

13
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 11:14:17 am »
You mean something like this?
LOOP
-If any cell is zero, stop loop, game not over
-If block0=block1 or block1=block5 or block1=block2  or... stop loop
-If loop goes to the block15 without finding any of the above, game over
ENDLOOP

14
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 11:06:02 am »
Yeah Game Over should be good, but it's hard to implement I think (best way to do it I think would be comparing the actuale game table and what would happen after every possible move). And my problem is not the color of the text but mostly the color of the empty cells (compare the two gifs in my first post, first grayscale looks blurry and moving).
So I tried to update (!) the text only when the score changes, it works BUT only shows the score for a fraction of a second, since the screen is then cleared with a Cleardraw :/

15
Axe / Re: [Axe game] 2048
« on: April 14, 2014, 10:57:12 am »
I saw one with animations and stuff, though I think the graphics weren't as schlick as mine tbh :D

Pages: [1] 2