About the screenshots, if you can get acces to a cse rom, use it to make animated screenies.
» Forum
> Your Projects
-
PT_
- Site Admin (Posts: 2088)
- 08 Sep 2015 09:21:40 am
- Last edited by PT_ on 08 Sep 2015 09:37:30 am; edited 1 time in total
I have optimized your code a lot, so falling is now smoother and merging tiles works good; but what if you have two blocks of the darkest color on each other? But anyway, here is my code; it saves around the 340 bytes . See the post above for the gif.
Code:
EDIT: here is the full code, with X-movement implemented
Code:
Code:
0->Xmin:264->Xmax
0->Ymin:164->Ymax
FnOff
CoordOff:GridOff:AxesOff
SetUpEditor SHADE
If not(dim(|LSHADE:Then
10->dim(|LSHADE
1->|LSHADE(1
End
Lbl 1
ClrDraw
BackgroundOff
Disp
DispGraph
For(A,164,0,~3
12(A>134)+(A<135)(22+int(A/45
Line(1,A,30,A,Ans
Line(234,A,264,A,Ans
End
TextColor(Black
Text(~1,20,70,"==SHADES==
TextColor(DarkGray
Text(~1,50,100,"START
TextColor(Gray
Text(~1,80,87,"OPTIONS
Text(~1,110,105,"QUIT
50->A:TextColor(Black
Repeat K=105
getKey->K
int(~.0172A^^2+2.6722A-51.556 // tricky :P
Text(~1,A,124-Ans,"<
Text(~1,A,124+Ans,">
If K=34 or K=25
Then
Text(~1,A,124-Ans," "
Text(~1,A,124+Ans," "
max(50,min(110,A+30sum(DeltaList(K={25,34->A
End
End
If A=110:Then
ClrDraw
ClrHome
Stop
End
If A=80:Then
ClrHome
ClrDraw
|LSHADE(1->S
If S<10
BackgroundOn S+9+(S>=3
If S>=10:BackgroundOn S-9-10(S=19
Disp :DispGraph
Text(150,0,"Background:
Repeat K=105
getKey->K
Text(150,90,"< ",sub("BlueRedMagentaGreenOrangeBrownNavyLtBlueYellowImage1Image2Image3Image4Image5Image6Image7Image8Image9Image0",S,1)," >
If K=24 or K=26:Then
Text(150,90," "
S+(K=26)-19(K=26)(S=19)-(K=24)+19(K=24)(S=1->S
S+9+(S>=3
If S<10
S-9-10(S=19
BackgroundOn Ans
Disp
DispGraph
End
End
S->|LSHADE(1
End
If A=80:Goto 1
ClrDraw
|LSHADE(1->S
If Ans<10
BackgroundOn Ans+9+(S>=3
If S>=10:BackgroundOn S-9-10(S=19
BorderColor 1
Disp :DispGraph
{12,12,12,24,23,22,21,20
For(Z,0,7
Line(0,2Z,264,2Z,Ans(Z+1
End
DelVar [A]{11,4->dim([A]
For(Z,1,4
6->[A](11,Z
End
149->A
1->B
LtGray->C
Repeat K=45 or max(seq([A](1,X),X,1,4
Repeat Ans
If [A](abs(int(A/15)-11),B
Then
C->[A](abs(int(A/15)-10),B
randInt(1,4->B
149->A
randInt(LtGray,DarkGray->C
End
Line(30B-29,A,30B,A,C
Line(30B-29,A+15,30B,A+15,0
A-3+(A=2->A
abs(int(A/15)-10->theta
If C=[A](Ans+1,B
Then
While C=[A](Ans+1,B) and 24>[A](Ans+1,B
1+[A](Ans+1,B->[A](Ans+1,B
0->[A](theta,B
C+1->C
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30B-29,Z+15,30B,Z+15,0
End
A-15->A
theta+1->theta
End
End
getKey
End
Ans->K
End
DelVar [A]
ClrHome
EDIT: here is the full code, with X-movement implemented
Code:
0->Xmin:264->Xmax
0->Ymin:164->Ymax
FnOff
CoordOff:GridOff:AxesOff
SetUpEditor SHADE
If not(dim(|LSHADE:Then
10->dim(|LSHADE
1->|LSHADE(1
End
Lbl 1
ClrDraw
BackgroundOff
Disp
DispGraph
For(A,164,0,~3
12(A>134)+(A<135)(22+int(A/45
Line(1,A,30,A,Ans
Line(234,A,264,A,Ans
End
TextColor(Black
Text(~1,20,70,"==SHADES==
TextColor(DarkGray
Text(~1,50,100,"START
TextColor(Gray
Text(~1,80,87,"OPTIONS
Text(~1,110,105,"QUIT
50->A:TextColor(Black
Repeat K=105
getKey->K
int(~.0172A^^2+2.6722A-51.556
Text(~1,A,124-Ans,"<
Text(~1,A,124+Ans,">
If K=34 or K=25
Then
Text(~1,A,124-Ans," "
Text(~1,A,124+Ans," "
max(50,min(110,A+30sum(DeltaList(K={25,34->A
End
End
If A=110:Then
ClrDraw
ClrHome
Stop
End
If A=80:Then
ClrHome
ClrDraw
|LSHADE(1->S
If S<10
BackgroundOn S+9+(S>=3
If S>=10:BackgroundOn S-9-10(S=19
Disp :DispGraph
Text(150,0,"Background:
Repeat K=105
getKey->K
Text(150,90,"< ",sub("BlueRedMagentaGreenOrangeBrownNavyLtBlueYellowImage1Image2Image3Image4Image5Image6Image7Image8Image9Image0",S,1)," >
If K=24 or K=26:Then
Text(150,90," "
S+(K=26)-19(K=26)(S=19)-(K=24)+19(K=24)(S=1->S
S+9+(S>=3
If S<10
S-9-10(S=19
BackgroundOn Ans
Disp
DispGraph
End
End
S->|LSHADE(1
End
If A=80:Goto 1
ClrDraw
|LSHADE(1->S
If Ans<10
BackgroundOn Ans+9+(S>=3
If S>=10:BackgroundOn S-9-10(S=19
BorderColor 1
Disp :DispGraph
{12,12,12,24,23,22,21,20
For(Z,0,7
Line(0,2Z,264,2Z,Ans(Z+1
End
DelVar [A]{11,4->dim([A]
For(Z,1,4
6->[A](11,Z
End
149->A
1->B
LtGray->C
Repeat K=45 or max(seq([A](1,X),X,1,4
getKey->K
If [A](abs(int(A/15)-11),B
Then
C->[A](abs(int(A/15)-10),B
randInt(1,4->B
149->A
randInt(LtGray,DarkGray->C
End
B->F
max(1,min(4,B+sum(DeltaList(K={24,26->B
If B!=F
Then
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30F-29,Z+15,30F,Z+15,0
End
A-12->A
End
Line(30B-29,A,30B,A,C
Line(30B-29,A+15,30B,A+15,0
A-3+(A=2->A
abs(int(A/15)-10->theta
If C=[A](Ans+1,B
Then
While C=[A](Ans+1,B) and 24>[A](Ans+1,B
1+[A](Ans+1,B->[A](Ans+1,B
0->[A](theta,B
C+1->C
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30B-29,Z+15,30B,Z+15,0
End
A-15->A
theta+1->theta
End
End
End
DelVar [A]
ClrHome
There are five colors that the tiles can be, between ltgray and darkgray. If a darkgray falls on a darkgray, they shouldn't merge. My thoughts are that the only way to get rid of the darkgray ones are to eliminate them by rows, if an entire row is the same color tile. You can see that in the ios gameplay video.
Unicorn wrote:
Wow, that looks really good! Such smooth scrolling, and are the colors customizable?
Thanks! (a lot of the credit goes to PT_ however). I was thinking I would not make tile colors customizable since that could get confusing on which tile color is the darkest (non-mergeable), and gray was the only one the calculator had multiple shades of.
PT_: I just tested your code, and it's great! X movement seems really good, and I love how the colors merge! There are some small issues that I can probably fix though, such as a domain error on the background color options (with var S), and some screen shifting values that need to be changed.
[edit]
I'm thinking about a soft/hard drop as well, similar to how tetris does it. The limitation though is that I don't know how to make them fall faster unless I make the tiles with more empty lines in between them, which isn't exactly very nice. I could slow down the game and speed it up to the speed it is now if you're doing one of those drops, but that would obviously not be wanted either since that would be slow.
Also, there are some graphical (and possibly internal) issues. Say I move a tile over 1 X value when there is a tile the way I moved, then I will be stacked on top of that tile, just that the entire tile I stacked on top of won't be displayed completely... Need to fix it so that you can't move in the direction of another tile if any part of your tile is touching it.
Another less important issue: the tile drops a little bit faster when moving left/right. Could be nice, but idk.
For hard drop, you can use this code, is it about 1.5-2x faster then normal falling down.
Code:
Code:
// ....
Repeat K=45 or max(seq([A](1,X),X,1,4
getKey->K
If [A](abs(int(A/15)-11),B
Then
C->[A](abs(int(A/15)-10),B
If min(seq(C=[A](theta,X),X,1,4
Then
[A]
For(X,2,10
rowSwap(Ans,X,1
End
For(Z,1,4
0->[A](1,Z
End
End
//randInt(1,4->B
// Only for testing
1->B
149->A
//randInt(LtGray,DarkGray->C
21->C
End
B->F
max(1,min(4,B+sum(DeltaList(K={24,26->B
If B!=F
Then
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30F-29,Z+15,30F,Z+15,0
End
A-12->A
End
Line(30B-29,A,30B,A,C
Line(30B-29,A+15,30B,A+15,0
A-3->A
If K=34
Then
abs(int(A/15)-10
While not([A](Ans+1,B
Line(30B-29,A,30B,A,C
Line(30B-29,A+15,30B,A+15,0
A-3->A
abs(int(A/15)-10
End
End
abs(int(A/15)-10->theta
If C=[A](Ans+1,B
Then
While C=[A](Ans+1,B) and 24>[A](Ans+1,B
1+[A](Ans+1,B->[A](Ans+1,B
0->[A](theta,B
C+1->C
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30B-29,Z+15,30B,Z+15,0
End
A-15->A
theta+1->theta
End
End
End
DelVar [A]
ClrHome
Very nice PT_! That will work.
Also, I can tell that the game is internally deleting rows of the matrix when it needs to, but the shifting of the screen doesn't seem to be working. However, for some weird reason, the shift registers once the game ends - but not in game. Do I need to do Disp :DispGraph or something, or can you fix that mateo? Also mateo (or whoever wants to do it, you don't have to necessarily), if you could do me another favor this would be great: make the screen shift program just like how I already have it, where it takes a value in Ans and shifts the screen down that much while keeping the bar on the bottom, but instead of the whole screen, could you make it only shift the gameplay area? That goes from x=0 (the left of the screen) to x=124. At 125-128, I have a thick 4 pixel wide black line that separates the gameplay area.
Thanks in advance
[edit]
I tried the Disp :DispGraph thing after shifting the screen, and it worked. If it's not too much of a problem though, it may be better to just fix the shift program.
Also, I can tell that the game is internally deleting rows of the matrix when it needs to, but the shifting of the screen doesn't seem to be working. However, for some weird reason, the shift registers once the game ends - but not in game. Do I need to do Disp :DispGraph or something, or can you fix that mateo? Also mateo (or whoever wants to do it, you don't have to necessarily), if you could do me another favor this would be great: make the screen shift program just like how I already have it, where it takes a value in Ans and shifts the screen down that much while keeping the bar on the bottom, but instead of the whole screen, could you make it only shift the gameplay area? That goes from x=0 (the left of the screen) to x=124. At 125-128, I have a thick 4 pixel wide black line that separates the gameplay area.
Thanks in advance
[edit]
I tried the Disp :DispGraph thing after shifting the screen, and it worked. If it's not too much of a problem though, it may be better to just fix the shift program.
And for the last bug:
Code:
Code:
If B!=F
Then
If not([A](min(11,theta+2),B
Then
For(Z,A+3,A-12,~3
Line(30B-29,Z,30B,Z,C
Line(30F-29,Z+15,30F,Z+15,0
End
A-12->A
Else
F->B
End
End
Niceee PT_ Just noticed another thing which I'm not quite sure how to solve, which may require a bit of a change to the shifting program, I don't know. If you get a line of tiles exactly the same color, and it's not on the bottom, the program doesn't adjust for that yet. It only eliminates the bottom row, internally AND graphically, instead of eliminating the row that should have been cleared. Going to need to figure out how to eliminate certain rows graphically, and also, any tiles that are hovering in mid-air because of the elimination need to fall down (I don't think they need to be animated down, they could just be erased and then redrawn at the new spot?).
I'm thinking adjusting it internally in the matrix should be fairly easy though.
[edit]
ahh, mateo, perhaps you could adjust your program a bit. You know how it currently leaves the bottom bar alone? perhaps that could be left as a variable instead, so I can specify where the screen shift should start, leaving however much of y=0 to y=N alone. That way I could eliminate a certain line graphically.
I'm thinking adjusting it internally in the matrix should be fairly easy though.
[edit]
ahh, mateo, perhaps you could adjust your program a bit. You know how it currently leaves the bottom bar alone? perhaps that could be left as a variable instead, so I can specify where the screen shift should start, leaving however much of y=0 to y=N alone. That way I could eliminate a certain line graphically.
Sorry about the late things, been a bit busy lately. Here's the program that you requested, I think you may find it useful. It should auto-update on the graphscreen.
Here's the usage:
Code:
ScrollDownAmount - The amount by which to scroll down
LeftMost_X_Position - The x value to offset from the left most side of the graph screen
LengthOf_X - The length of the line we are shifting down
YBottomValue - Measured from the top, how many lines to actually use while shifting
NOTE:LeftMost_X_Position and LengthOf_X have to be divided by 2. This is a because of how the graph screen is structured; and I really don't like it.
EXAMPLE: Shift the screen down 5 pixels, from x=0 to x=124 and leave 15 pixels on the bottom of the screen intact:
Code:
Download: Shift.8xp
Hope this helps! Please let me know of any bugs, or things that are odd. Thanks!
EDIT: If you would like; I could modify it so that it takes inputs from the list in L1 or something rather than Ans. This way it doesn't have to waste time.
Source:
Code:
Here's the usage:
Code:
{ScrollDownAmount, (LeftMost_X_Position)/2, (LengthOf_X)/2, YBottomValue
Asm(pgrmShift
ScrollDownAmount - The amount by which to scroll down
LeftMost_X_Position - The x value to offset from the left most side of the graph screen
LengthOf_X - The length of the line we are shifting down
YBottomValue - Measured from the top, how many lines to actually use while shifting
NOTE:LeftMost_X_Position and LengthOf_X have to be divided by 2. This is a because of how the graph screen is structured; and I really don't like it.
EXAMPLE: Shift the screen down 5 pixels, from x=0 to x=124 and leave 15 pixels on the bottom of the screen intact:
Code:
{5,0,62,150
Asm(pgrmShift
Download: Shift.8xp
Hope this helps! Please let me know of any bugs, or things that are odd. Thanks!
EDIT: If you would like; I could modify it so that it takes inputs from the list in L1 or something rather than Ans. This way it doesn't have to waste time.
Source:
Code:
.nolist
#include "ti84pce.inc"
.org UserMem-2
.db tExtTok,tAsm84CeCmp
.list
call _RclAns
ld a,(plotsscreen)
ld (colorIndex),a
push de
push de
push de
ld hl,1
call _GetLToOP1
call _ConvOP1 ; amount down
ld (ScrollAmt),a
or a,a
jp z,exitpop3
ld hl,2
pop de
call _GetLtoOP1 ; xright
call _ConvOP1
ld (XLeft),a
ld hl,3
pop de
call _GetLtoOP1 ; xleft
call _ConvOP1
ld (XLength),a
ld a,(XLeft)
add a,e ; is this >= 133
cp 266/2
pop de
ret nc
ld hl,4
call _GetLtoOP1 ; ybottom
call _ConvOP1
ld (YBottom),a
ld (YBottomTmp),a
or a,a
ret z
ScrollAmt: =$+1
ld b,0
_:
push bc
ld b,a
_:
push bc
YBottom: =$+1
ld a,0
call GetLine
push hl
dec a
call GetLine
ex de,hl
pop hl
ld a,(XLength)
inc a
ld b,a
_:
ld a,(de) ; previous line
ld (hl),a ; copy it to the next line
dec hl
dec de
djnz -_ ; Okay; now we've copied a single line... But we need to do this all the way to the top.
pop bc
ld hl,YBottom
dec (hl)
djnz --_
xor a
call GetLine ; hl->thingy
ld a,(XLength)
ld b,a
_:
colorIndex: =$+1
ld (hl),0 ; copy it to the next line
dec hl
djnz -_ ; Okay; now we've copied a single line... But we need to do this all the way to the top.
YBottomTmp: =$+1
ld a,0
ld (YBottom),a
pop bc
djnz ----_
call $0210A0 ; Redraws the graph buffer
ret
exitpop3:
pop de
pop de
pop de
ret
GetLine:
ld d,a ; b=YBottom
ld e,266/2 ; width of line
mlt de ; de->bottom line
ld hl,plotSScreen ;
add hl,de ; hl->on buffer
ld de,0
XLeft: =$+1
ld e,0
add hl,de ; hl->good
XLength: =$+1
ld e,0
add hl,de ; hl->end of line? Yes.
ret
Thanks Mateo! I'll have to test it in the program to make sure, but just one thing when I quickly tested it via the home screen: the new updated graph screen showed up, but the home screen was still visible as a border. Kind of like the graph screen was overlayed on the home screen. Again, this will probably not be the case inside the program, but I just thought I'd say that
I'm looking at some gameplay footage to figure out what the scoring system is like for the most part. Here's what I've figured out:
Here's some gameplay I'm basing this off of:
[Link]
And I believe that is it! If it is not, please correct me Now time to implement it
- Setting a tile down - 2 points
Merging a tile - 4^(number of tiles merged in combo) points
Clearing a row - 200 points
Also, you level up every 500 points
Here's some gameplay I'm basing this off of:
[Link]
And I believe that is it! If it is not, please correct me Now time to implement it
*bump*
Everything is done, now that I added the score counter. It would be nice to have a pause feature though... Now I just have to write the readme, and the program should be released within the next few days
I'll try and make a video if I can.
Everything is done, now that I added the score counter. It would be nice to have a pause feature though... Now I just have to write the readme, and the program should be released within the next few days
I'll try and make a video if I can.
I am happy to announce that Shades is finally out! I'll see if I can make a video/gif here soon
Download:
Shades for the TI-84 Plus CE
Download:
Shades for the TI-84 Plus CE
Just released version 1.1, which has optimizations by PT_ and a bug fix And I added screenshots to the download page, however the gif isn't exactly what the finished game looks like.
Here's a new gif of what it actually looks like.
This is still without the shift function, since I don't have a CE.
Is there probably anyone who would trying to port Mateo's shift program to the CSE? That would be very awesome . After that, we can make better gifs and I can test the shifting too.
Michael and I are thinking of a way to make the game (progressively) harder, any ideas on that are always welcome.
This is still without the shift function, since I don't have a CE.
Is there probably anyone who would trying to port Mateo's shift program to the CSE? That would be very awesome . After that, we can make better gifs and I can test the shifting too.
Michael and I are thinking of a way to make the game (progressively) harder, any ideas on that are always welcome.
PT_ wrote:
Michael and I are thinking of a way to make the game (progressively) harder, any ideas on that are always welcome.
*bump* anybody have any ideas on this? Also, PT_, have you thought about this at all? I'm currently at a loss of ideas.
Michael2_3B wrote:
PT_ wrote:
Michael and I are thinking of a way to make the game (progressively) harder, any ideas on that are always welcome.
*bump* anybody have any ideas on this? Also, PT_, have you thought about this at all? I'm currently at a loss of ideas.
Any ideas on this?
For me, I thought that extra speed is not an option, since we only use BASIC. So what I thought was add random blocks each time you go a level up. Something like this:
Code:
If level_up
Then
For(A,0,level/2
add_block_somewhere
End
End
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page Previous 1, 2, 3 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 3
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement