Hurray, this project won project of the month for April 2017!

It also won 4th place in Projects of the Year 2017!


As you may know, I have been trying to think of good ideas for games for the CE, in TI-Basic. I finally started programming this game for the CE, a port of Shades. I will probably keep the name, unless someone suggests something else.

Download:
Shades for the TI-84 Plus CE


Screenshots



Original iOS Gameplay:

[Link]
This sounds interesting. May I ask how you manage to scroll a part of the screen down when a line got filled and disappeared?
Also, how are you drawing the recangles?

I am looking forward to seeing what this will get to, unfortunately I suppose I won't have Internet access during the next three weeks...
I only have the basic stuff, more or less, down. I have a fully functional menu along with a change background option, and random fallings of random colored blocks. Currently there is no X movement code yet, or color combining, or line eliminating or anything like that. Just blocks falling onto each other.

With that said, actually it would be very nice to have specifically a shift screen down 3 for the CE (@ mateo, maybe you could figure this out?). Otherwise I may have to convert this game so that it's just text...

Oh, and I put some screenshots up above!

[edit]
Mateo: I don't need this on any timely basis, but it would be nice to have a hexcode here soon. I would like it so that I can specify the direction and amount of shift in Ans or something, and also when it does shift it keeps the background that is currently on. I don't know how hard that would be, but hopefully you can do it Smile

Oh, and I also need a quick way to erase the block, move the x, and redraw the block as fast as possible if the player presses right or left. I'll think about this one, and hopefully get a fairly speedy result.

One of the bugs I'm currently trying to sort out is why same-color tiles are not combining.
Michael2_3B wrote:
Mateo: I don't need this on any timely basis, but it would be nice to have a hexcode here soon. I would like it so that I can specify the direction and amount of shift in Ans or something, and also when it does shift it keeps the background that is currently on. I don't know how hard that would be, but hopefully you can do it Smile

Oh, and I also need a quick way to erase the block, move the x, and redraw the block as fast as possible if the player presses right or left. I'll think about this one, and hopefully get a fairly speedy result.

One of the bugs I'm currently trying to sort out is why same-color tiles are not combining.


Okay; sorry, this is what I meant by exactly. Smile So, when you shift down, does the data on the graphscreen shift down? Or just to that black and white bar on the bottom? Do you want it to just disappear, or scroll slowly? I understand that it should also preserve the background color in some way. How tall is that bar? Thanks! Smile

I guess I could get rid of the bar, but then it would look like the tiles are floating... and I'm too lazy to adjust my formula for converting exact y value to a matrix y value Razz

So sorry if this makes it harder on you, but I would like to keep the bar. It is, uhm, 15 tall. I think. Since it includes y=0 I would go with 16. If that doesn't work hopefully it can be changed to 15 easily Smile
Oh cool, so its some form of tetris! I wonder how well displaying the squares will work, doesn't the CE have superior graphics displaying abilities than the CSE?

Anyways, can't wait to see some form of an animated screenshot!
Could you give a brief explanation on what the game is about?
Basically you try and merge tiles together that are the same color, and when you have a line of one color (the darkest is black, obv), that line clears and all the tiles above it fall down by 1.

You just try and survive as long as you can. One of the bad things that you want to avoid is putting a darker tile on top of a lighter tile, because then you can't merge the one below it :/
Basically tetris but there are only 4 blocks in each row and it drops 1 block at a time and you have to merge tiles?
Yup. Btw, I did put a gameplay video in the original post.
I just didn't have time to watch it.
Okay, I'm really sorry I didn't get this to you earlier; I have been quite busy with life and things at the moment. Smile Here you are; it shifts the screen down by the specified number of pixels in Ans. So,

Code:
3:Asm(pgrmDOWN

Would shift the graphscreen down by three lines. Hope this helps! Smile It also preserves the color, and the bar at the bottom... Not sure if you want this functionality changed or optional? Also, in order to preserve the background color, it looks at the pixels located at 0,0 and 1,0. Then just copies them. It would be impossible to make it an actual picture for now.

Assembly Code:

Code:
CD 50 0F 02  call _RclAns
D8 -  -  -   ret c
E6 1F -  -   and $1F  ; RealObj
C0 -  -  -   ret nz
CD 70 0F 02  call _ConvOP1
43 -  -  -   ld b,e
3A 66 94 D0  ld a,(plotSScreen)
32 B4 A8 D1  ld (BGcolor),a
C5 -  -  -   push bc
21 CF E1 D0   ld hl,plotSScreen+(266/2*164)-(266/2*15)
11 54 E2 D0   ld de,plotSScreen+(266/2*165)-(266/2*15)
01 68 4D 00   ld bc,266/2*164-(266/2*15)-1
ED B8 -  -    lddr
21 66 94 D0   ld hl,plotSScreen
01 84 00 00   ld bc,266/2-1
E5 -  -  -    push hl
D1 -  -  -    pop de
13 -  -  -    inc de
36 00 -  -    ld (hl),0
ED B0 -  -    ldir
C1 -  -  -   pop bc
10 DF -  -   djnz -_
C9 -  -  -   ret


Umm... Here you go, I guess?:

Code:
Asm84CEpgrm
CD 50 0F 02
D8
E6 1F
C0
CD 70 0F 02
43
3A 66 94 D0
32 B4 A8 D1
C5
21 CF E1 D0
11 54 E2 D0
01 68 4D 00
ED B8
21 66 94 D0
01 84 00 00
E5
D1
13
36 00
ED B0
C1
10 DF
C9

Hope this helps! (Don't forget to use the Asm84CEpgrm token. Smile )
Welp, I'm not totally surprised. It did a RAM reset when I ran that. Unless it needs to be run inside the program? Because I just simply did a test outside a program by drawing some lines on the graph screen and then running the Asm( token (along with a number in Ans before hand). But I doubt that would cause an issue. Don't you need to have an odd number of tokens in one line or something for it to work?

Also, what would be a quick, fast method of moving a matrix a layer down? The matrix is 4 wide and 11 tall. The last row of elements is a placeholder so that when a tile hits the bottom it sees the next row down as having something, so it stacks on top of it. Anyways, so what I want to happen is to have the 10th row of elements deleted (or any other row, depending on how I decide to design the game), then move all the rows of elements above that down by 1 element. I know I could use some For() loops but that may be a bit slow.
Michael2_3B wrote:
Welp, I'm not totally surprised. It did a RAM reset when I ran that. Unless it needs to be run inside the program? Because I just simply did a test outside a program by drawing some lines on the graph screen and then running the Asm( token (along with a number in Ans before hand). But I doubt that would cause an issue. Don't you need to have an odd number of tokens in one line or something for it to work?


It should not cause a RAM reset unless you are doing something funky. It does not need to be line separated; that's just how the assembler spits things out. Seriously, you can put each nibble one right after the other. Are you putting in the spaces? Here's the downloadable program itself before it breaks more things:

Download
"Before it breaks more things..."

lol
Yup, that worked! I still have to test it in the program though. Will give an update when I get something significant to show Smile I'll try and do a video soon.
Couldn't you just do this in pure BASIC with a list?
solarsoftware wrote:
Couldn't you just do this in pure BASIC with a list?

What do you mean, by the way?

Currently I still need to get some major game necessities in, but I am having a bit of trouble.
-Moving tiles left and right when they're falling (kind of a speed issue as well - have to erase tile and redraw it, which in pure basic, will take a bit. Unfortunately I can't use Text() since that disrupts the background).

-Merging tiles doesn't seem to work yet.

-Still have to add in row deletion (thanks to mateo, I have a shift screen ASM program, just have to implement it)

Current code! If anyone wants to work on this a bunch and/or optimize it, I'd be happy to make you a co-author Smile

Code:

0->Xmin:264->Xmax
0->Ymin:164->Ymax   //is there a better way? the 1->DeltaY doesn't set it up correctly.
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
 expr(sub("BLACKBLACKBLACKDARKGRAYDARKGRAYDARKGRAYGRAYGRAYGRAYMEDGRAYMEDGRAY",abs(int(A/15)-11),1
 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
 Text(~1,A,85(A=50)+72(A=80)+90(A=110),"<
 Text(~1,A,164(A=50)+175(A=80)+157(A=110),">
 If K=34 or K=25:Then
  Text(~1,A,85(A=50)+72(A=80)+90(A=110),"
  Text(~1,A,164(A=50)+175(A=80)+157(A=110),"
  A+30((K=34)(A<110)-(K=25)(A>50->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
   If S<10
    BackgroundOn S+9+(S>=3
   If S>=10
    BackgroundOn S-9-10(S=19
   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
Line(0,0,264,0,BLACK
Line(0,2,264,2,BLACK
Line(0,4,264,4,BLACK
Line(0,6,264,6,DARKGRAY
Line(0,8,264,8,GRAY
Line(0,10,264,10,MEDGRAY
Line(0,12,264,12,LTGRAY
Line(0,14,264,14,WHITE
DelVar [A]{11,4->dim([A]
For(Z,1,4
 1->[A](11,Z   //non-mergeable - placeholder
End
149->A:0->B:LTGRAY->C
Repeat K=45 or [A](1,1) or [A](1,2) or [A](1,3) or [A](1,4
 Repeat Ans
  If [A](abs(int(A/15)-11),B+1:Then
   C->[A](abs(int(A/15)-10),B+1
   randInt(0,3->B
   149->A:randInt(LTGRAY,DARKGRAY->C
  End
  Line(30B+1,A,30B+30,A,C
  Line(30B+1,A+15,30B+30,A+15,0
  A-3+(A=2->A
  If [A](abs(int(A/15)-10),B+1)=[A](abs(int(A/15)-11),B+1) and [A](abs(int(A/15)-10),B+1) and [A](abs(int(A/15)-10),B+1)<5:Then

//merging tiles

   Repeat [A](abs(int(A/15)-10),B+1)!=[A](abs(int(A/15)-11),B+1) or [A](abs(int(A/15)-10),B+1)=5
    If [A](abs(int(A/15)-10),B+1)<5:Then
     0->[A](abs(int(A/15)-10),B+1)
     1+[A](abs(int(A/15)-11),B+1->[A](abs(int(A/15)-11),B+1
     C+1->C
     For(Z,A-15,A-30,~3   //drawing the merged tile, but does not work
      Line(30B+1,Z,30B+30,Z,C
      Line(30B+1,Z+15,30B+30,Z+15,0
     End
     A-15->A
    End
   End
  End
  getKey
 End
 Ans->K
End
DelVar [A]
ClrHome


Videos coming (since I can't do gifs of the CE) soon Smile
EDIT: DOWNLOAD!

EDIT 2: Anyone have any thoughts on this?
Michael2_3B wrote:
Also, what would be a quick, fast method of moving a matrix a layer down? The matrix is 4 wide and 11 tall. The last row of elements is a placeholder so that when a tile hits the bottom it sees the next row down as having something, so it stacks on top of it. Anyways, so what I want to happen is to have the 10th row of elements deleted (or any other row, depending on how I decide to design the game), then move all the rows of elements above that down by 1 element. I know I could use some For() loops but that may be a bit slow.
Michael2_3B wrote:
EDIT 2: Anyone have any thoughts on this?
Michael2_3B wrote:
Also, what would be a quick, fast method of moving a matrix a layer down? The matrix is 4 wide and 11 tall. The last row of elements is a placeholder so that when a tile hits the bottom it sees the next row down as having something, so it stacks on top of it. Anyways, so what I want to happen is to have the 10th row of elements deleted (or any other row, depending on how I decide to design the game), then move all the rows of elements above that down by 1 element. I know I could use some For() loops but that may be a bit slow.



Code:
[A]:For(X,2,10
rowSwap(Ans,X,1
End


This works okay. Also, it moves the bottom row to the first row; so just clear the first row yourself. Hope this helps! Smile
MateoConLechuga wrote:


Code:
[A]:For(X,2,10
rowSwap(Ans,X,1
End


This works okay. Also, it moves the bottom row to the first row; so just clear the first row yourself. Hope this helps! Smile

I've never used that command, so thanks for reminding me of it! That does not work very well though, so I came up with this:

Code:

[A]:For(X,10,1,~1
rowSwap(Ans,X,X+1
End:Ans->[A]
For(X,1,4
0->[A](1,X
1->[A](11,X   //place-holder
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
Page 1 of 3
» All times are GMT - 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

 

Advertisement