I had to do it. I couldn't find Bejeweled in the Cemetech file archives (didn't check anywhere else) so I figured I'd give it a shot! (Though I would've done it anyway even if I'd found something. Smile)
Everything is written in BASIC with the DCSE libraries.

EDIT: Game is done, download here: http://www.cemetech.net/programs/index.php?mode=file&id=1327

Here's a screenshot so far.


Here's a very early screenshot for speed comparisons (I find it interesting you might too?)


TODO:
* Score - Done
* Levels (maybe) - Done
* Try checking for game over without killing speed too much - Done
* Save game on quit - Done
* More and better backgrounds - Done
* Add bonus gems for combining sets of 4 and 5 like the original game had - Replaced with extra cleared gems on sets of 4/5
* ???
* Optimize Optimize Optimize


I'm not entirely convinced game-over checks are necessary, as long as there's a manual restart option. However, a good middle-ground solution is probably to add a button which checks to see if there is a possible move, rather than forcing a check after every move.

I'm going to try and work on having a variety of backgrounds (the current one is the result of a quick google search for space Razz). I don't want to force people to use up a lot of archive though so I plan to make them optional. The program will just use whatever backgrounds are there, or a solid color if there's nothing.

Big thanks to merth for TokenIDE, the indentation support has been helpful like you would not believe.
I have an idea for an algorithm for game over checking. It might help. It might not.

Anyways, there are 12 patterns that make it possible to continue. They would be as follows (each 4px*4px red square being a jewel matching the other 4px*4px red squares):


It's really 6, and then those 6 rotated 90 degrees. It doesn't matter if the the number of jewels in the finished chain is 3, 4, or 5. These patterns show up everywhere.

So what you need to do is search your map for these patterns, and stop searching when you find at least one. You need to check at most 84 times (42 for the portrait oriented patterns, and 42 for the landscape oriented patterns), which is a lot, but I feel like it can be done.

The algorithm would end up something like this:

Code:

do
  player moves
  boolean playable = false
  for(x=0, x < 7, x++)
    for(y=0, y < 7, y++)
      if(x <= 5)
        Check each landscape oriented pattern with the current tile at the top left.
        If one matches, set playable = true and break from the loop
      if(y <= 5)
        Check each portrait oriented pattern with the current tile at the top left.
        If one matches, set playable = true and break from the loop
while playable == true
game over


Anyways, hope this at least sparks a thought to start the game over checking
Wow! This looks incredible!

I like where you're going with the board checking idea pimath.
Switched to matrices for storing the level, and DeltaList for searching for matches. Result was a huge speed up

aww yeeesss

Keep it up!
This is really looking great, unknownloner. Every time I see interesting TI-84 Plus CSE TI-BASIC programs like this, I become more hopeful that we'll be able to run xLIBC and Doors C[S]E on the new TI-84+CE. Smile Yesterday you were talking about some interesting math you had put together using deltaList and raising those deltas to powers; did you still need help verifying the correctness of your solution?
Looks great indeed! At first I didn't pay attention to the second half of the topic title because you usually do ASM and I assumed this program was in ASM too, but it looks very nice and fun for hybrid BASIC. I agree with Kerm that such capabilities would be nice on the TI-83PCE and TI-84+CE. It would be a shame if those new calcs were restricted to ROL3-esque speed via the slow Asm() command.
I really think that this program will be a hit! I know I (and lots of others at my school) will download it. What I really think you should add is maybe some sort of sparkle/explosion effect when you get 4 or 5 in a row, and power up like things could also make it much more interesting. Also if you came up with a way to make the game change more often, or put more modes in it (easy, medium, hard, etc) the game could be even better. Smile
KermMartian wrote:
Yesterday you were talking about some interesting math you had put together using deltaList and raising those deltas to powers; did you still need help verifying the correctness of your solution?

No, I'm good. I wrote a program to check it and found that there were actually only two false positives when raising to the power of two: {7, 5, 1} and {1, 5, 7}. There were none when raising to a power of three. I was just lucky enough to have {7, 5, 1} on my current starting board, so I could notice something was wrong.

DWMelon wrote:
What I really think you should add is maybe some sort of sparkle/explosion effect when you get 4 or 5 in a row, and power up like things could also make it much more interesting.

Indeed this is the plan! From what I remember, in the original bejeweled matching 4 would create an explosive gem and matching 5 would create a gem that could destroy all gems of a certain type. I'm not entirely sure how feasible the explosive gem is (I may just need to trigger an explosion when you match 4) but I definitely want that 5-gem in there.



On the subject of checking for game-over: I haven't had a chance to try out any code yet, but my plan is to attempt it in BASIC, and if it's too slow then I'll just write that part as an ASM sub-program.

I had an idea that just might work for doing it in BASIC though, even if it's slow. The idea is that I can perform one iteration of the game-over check every time the input loop runs. In other words, while you're moving the cursor around (or just sitting there looking for matches and not moving the cursor) it can check the board for valid matches. That way, if there ARE valid matches it can confirm them while still letting you play the game, but if there aren't then it can still alert you that the game is over.
Very neat work Unknownloner! Smile I second the idea of an explosion when you combine 4 or 5 gems together. I do remember from playing with Puzzle Frenzy that silly checks were just the worst. Best of luck to you! Smile
Been working on this at school when I've had time. I optimized the main board-clear loop with some reorganized code and finance variables. I also made the game generate a board at the start now. Next up, I'm planning to give some attention to the (lack of) UI. This entails adding score and a way to display it basically. Also, here's a video of it running on hardware!

Here's a potential in-game menu. Any feedback on improvements to it would be appreciated. In other words, anything that would make it look nicer. Only requirement is it has to completely cover the board area.


As you can see, you can scroll through the menu and it will wrap at the top/bottom. When you select an option it colors that option green before quitting out of the routine to convey that the option has been selected, even if there is a delay for processing between selecting the option and the effect being shown. Just your run of the mill menu Razz.
A border of gems!!!
Random confetti!!!
I really don't know... Do you NEED a non-run-of-the-mill menu?
I think the menu looks find as-is. Maybe just underline the "Options" text.
How'd you get the background all set up? I might need this help for my programs.
I assume he's using DisplayBGPic( or something similar.
gaventemples31415 wrote:
I really don't know... Do you NEED a non-run-of-the-mill menu?

Nah, I don't. I just commented on that 'cause I didn't want it to look like I was trying to present the menu as if it were some crazy new thing nobody had ever seen before Very Happy

merthsoft wrote:
I think the menu looks find as-is. Maybe just underline the "Options" text.

Thanks for the suggestion Merth, I think it looks better


solarsoftware wrote:
How'd you get the background all set up? I might need this help for my programs.

I converted the image to a background image appvar with TokenIDE and then draw it with the xLIBC routines for drawing those background images.


EDIT:
Score is a thing now. The scaling at the beginning is a little low for testing purposes, but rest assured it does scale exponentially.


When you reset the level, it resets your score to what you had when the level starts
Looks awesome! Has the speed has increased some more?
Maybe, maybe not. I've been optimizing code as I see things to optimize while working on the new stuff but I haven't been keeping track of it.
I've gotten back to working on this, I'm polishing it up to be releasable.

I've been working on making more backgrounds. Right now the plan is to have a bunch of appvars with the same name in different folders. You can send whichever one you want to your calc for that to be the background.

DJ Omnimaga sent these backgrounds my way, I think they look pretty neat:











==Edit==
"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.
Once it's confirmed that the game is over it'll display a game over screen, and then after you press a button it restarts the game.

  
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 2
» 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

 

Advertisement