Oh, this looks great! I've spent so much time on BeNumbered.

UnknownLoner wrote:
"Asynchronous" game-over detection works now.
By that I mean it runs game-over detection in the background while you make your next move, since it takes so long to process.
As soon as a potential match is found, game-over checking stops to make the input loop even more responsive.


Uhh, so, to the user, the game will all of a sudden get faster for a moment? that sounds kinda iffy, speed should be as constant as you can get it - from my view.
Luxen wrote:
Uhh, so, to the user, the game will all of a sudden get faster for a moment? that sounds kinda iffy, speed should be as constant as you can get it - from my view.
The only thing that will get slightly faster is the ability to move the selection box around the screen. Unknown, did you test if it was severe enough to be confusing to the player? I'm sure it would be trivial to add a rand(X) statement in there to slow it down after the game-over detection has determined that the game is not over, but I suspect the difference in speed is not stark enough to warrant that.
There is a generous daily between a user input and the start of game-over detection. Essentially the input loop must run a set amount of times without key input before it even begins doing any checks. This counter is reset any time a key is pressed. A player may notice a slight delay on their first input if they haven't pressed anything in awhile, but while they're moving around they should be unaffected. Forcing a constant-time input loop with rand or similar would cause the game to be unplayable by my standards.
Can you give me some steps to make a background out of a 160*120 image? I have TokenIDE, but how I'm doing it with that isn't working (the background doesn't show up).

EDIT: Never mind.
Porting the game to pure BASIC so it can run on the 84+CE.


The screen flashes and buggy-looking black borders around tiles are the result of a bug on the CSE. The CE doesn't have that, so everything will look correct on it.
I'm also going to experiment with 6x6 tiles instead of 7x7. If I can get it to run quickly, I'll use that.
Wow, nice Smile To bad there is no background support :
Well technically I think you could just enable a background like you normally can on the CSE and have it work with this.

EDIT: It does look a little odd though
True, the built in TI images would work. Maybe that renders a mention in the readme?
*deserves a mention? Smile

As UnknownLoner requested, I gave the pure TI-BASIC TI-84+CE port that he made a try, and it works great. I will complain that the tiny game board makes my eyes hurt slightly, straining to distinguish the orange tiles from the red tiles, but it is fast, functional, and I didn't find any bugs. Nice work!
I agree that the tiles are smaller than I'd like, but such are the sacrifices of pure BASIC. I think I could make a text-based version as well which would use different (home screen) characters instead of colors. Stay tuned for that.
I am working on porting xLIBC to the CE - but it will be a slow road unfortunately.

I was wondering if you could tell me the functions that you are using in this game? That way I can look at getting them working first.

Note that I will be attempting to make it so that the majority of xLIBC games will work unmodified on the CE ... well hopefully Smile.
Setup:
SetUpGraphics(
SetSpeed( - Probably unnecessary, I just set it to 15Mhz just in case.
SetupColorMode(4,255,0 - I don't even know why this is in my code anymore. Originally it was supposed to fill the screen with white to make the home screen look better, but since I use both sides of the LCD now it doesn't really accomplish that goal. I'll probably remove it in a future update so don't bother right now.

Pics:
LoadTilePic(
DisplayBGPic32(

LCD Control:
GetLCDBuffer(
SetLCDBuffer(
UpdateLCD(
It's imperative that these three operate the exact same way they do on the CSE.

Shapes:
DrawRectangle(
FillRectangle(
InvertRectangle(
- It's worth noting that on the CSE, FillRectangle( will cause an LCD panic if a height of 0 is used. This is true with at least version 8.1.2 of DCSE. Irrelevant to the CE I know, but while it's on my mind I figured I'd add it here. I don't know if this is true of DrawRectangle or InvertRectangle, or if it applies to a width of 0.

Sprites:
DrawSpriteA(

Strings:
DrawString(
DrawStringValueA(

UserVars:
SetUservar(
GetUservar(
AddToUservar(
- Uservars are not 100% needed for the game to work, as proved by the pure BASIC version. I can move my changes over from that version to eliminate UserVar usage if you want, but the current public version uses UserVars and will not function without them.

Misc:
GetRand(
Unknownloner wrote:
I agree that the tiles are smaller than I'd like, but such are the sacrifices of pure BASIC. I think I could make a text-based version as well which would use different (home screen) characters instead of colors. Stay tuned for that.
That would probably be a lot easier if you had access to Doors CSE's DispColor function, but of course then you'd have Hybrid BASIC anyway, which makes it a bit of a moot point.
I tried out the game, but it was hard for me to differentiate between the orange and yellow jewels. Why wouldn't it be possible to make it all bigger? You would just be changing the scale of everything.
unknownln, I may be able to make game-over checking run in 4 to 6 seconds (depending on how well I can micro-optimize). Here's my code so far:


Code:

//Checks for 3x2 blocks that can form three in a row
//This goes over the columns of matrix [A]= and stores the type of gems in the position of the digit in each element of L3, which is the sum of two adjacent columns.
//Will not work for more than 13 gem types, unfortunately

For(D,0,1
Matr►list([A],1,L2
For(C,2,8
L2->L1
Matr►list([A],C,L2
.1(10^(L1)+10^(L2)(L1≠L2
augment(Ans,{0,0})+augment({0},augment({0},Ans)+augment(Ans,{0->L3
8->dim(L3
If .3≤max(max(fPart(L3/10^(L1)),fPart(L3/10^(L2
---break the loop; possible move found---
End
[A]ᵀ->A
End

//then repeat for rows

Have you considered using window variables and n in addition to finance variables? They're just as fast, and I think you want the extra speed.

The inner loop will be executed 14 times per board, compared to the ~49 values of G in your program; it also seems to be faster than yours per iteration. I have not yet added 4x1 checking, but I think the total time for a full-screen game-over check will be about 6 seconds.

EDIT: Here's 4x1 checking for list L1 in ~70 ms. I'm pretty sure this works, but not 100%. The magic constant is log_10(2).

Code:

max(.3010299957=abs(ΔList(log(abs(ΔList(ΔList(10^(L1


Note that this will throw a domain error on log(0) if there are any threes-in-a-row, but if this check is performed after all matches are removed, it should be fine. It would be great if the common computation between this and match checking were shared (ΔList(ΔList(10^(L1) but that doesn't seem advantageous given that they're in different parts of the code.

If 10^[A] can be precomputed, there would be significant gains in speed in both checks, but I don't know if there would be a net gain.
In your readme you mention that Sourcecoder can make the background AppVars, when in reality it can't. (Yet)

Quote:
You can get a custom background by replacing the BJWLBG.8xv file with your
own custom background. It must be a xLIBC compatible 160x120 pixel 32 color
image. You can make one with TokenIDE or SourceCoder.


Could you remove that, it might prevent some people from getting confused.

EDIT: It appears that the jewels are all glitched out and messed up on my calculator. I could not replicate it using jstified and re sending the data wouldn't fix it either.
I still have to re-position the UI elements (the score bar is missing and the text is on top of the game),
but TI-84+CE Pure BASIC Bejeweled coming soon.

"But what about colorblind people? They're all the same shape!"
Worry not, I'm going to include a second color-blind mode executable that uses different text symbols
for tiles, which you can use if you have trouble seeing color or just don't like the way the colors look.



Sorry about the breathing BTW, didn't realize it was so loud!
  
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 2 of 2
» 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