CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: unknownloner on July 05, 2015, 04:25:12 AM

Title: [TI-84+CSE] Bejeweled CSE [Hybric Basic]
Post by: unknownloner on July 05, 2015, 04:25:12 AM
Bejeweled for your CSE
Written in hybrid BASIC for DCSE
- Score system
- Combos
- Level up
- 'Asynchronous' game over detection
- Lightning fast for a BASIC program
- Includes backgrounds from DJ_O

Download: http://www.cemetech.net/programs/index.php?mode=file&id=1327

(http://i.imgur.com/2dVXinR.png)

(http://i.imgur.com/Hdruh6W.png)

(http://i.imgur.com/Z2BuMps.png)
Title: Re: Bejeweled CSE
Post by: CKH4 on July 05, 2015, 04:29:30 AM
Cool, is there a sort of menu for the game? I'll be sure to get this for my friend if we're in the same math class again. The sprites look nice. I look forward to playing this if I can.
Title: Re: Bejeweled CSE
Post by: unknownloner on July 05, 2015, 04:34:00 AM
Yes, there is a menu.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 05, 2015, 04:34:43 AM
I like how this came out. There should be a background with :walrii: in it as a secret level :P

Also I was shocked a few months ago when I saw this was in hybrid BASIC. It almost looks like an ASM game O.O

I'll definitively have to check this out :)

EDIT: This has now been cloned in the File downloads archives so the topic shows up in both sub-forums now :). Front-paged as well
Title: Re: Bejeweled CSE [Hybric Basic]
Post by: alexgt on July 05, 2015, 02:03:02 PM
Awesome! I had Bejeweled on my PDA and played it allot so I am sad I don'y have a CSE :(

Wait is there a CSE option on wabbit?
/me goes to check

EDIT: you can O.O I will try it out :)
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 05, 2015, 07:43:52 PM
Bug report: Background pictures don't work.

(https://img.ourl.ca/wabbitemu-7.png)

Title: Re: Bejeweled CSE
Post by: alexgt on July 05, 2015, 08:23:39 PM
They work on the EMU!?
Did you transfer all of the files that the readme said?
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 05, 2015, 08:40:46 PM
I tried both on calc and WabbitEmu. Could it be that I use OS 4.0, though?
Title: Re: Bejeweled CSE
Post by: DarkestEx on July 05, 2015, 09:53:28 PM
Really nice work, @unknownloner

Quote from: CKH4 on July 05, 2015, 04:29:30 AM
Cool, is there a sort of menu for the game? I'll be sure to get this for my friend if we're in the same math class again. The sprites look nice. I look forward to playing this if I can.
My maths teacher would kill and burn me before I had time selecting it from the menu. Even that I don't have a CSE nor any other color calc.
She hates everything and makes math one of the most horrible subjects possible.
Title: Re: Bejeweled CSE
Post by: alexgt on July 05, 2015, 10:59:07 PM
I checked and I was using 4.2 :-\
Title: Re: Bejeweled CSE [Hybric Basic]
Post by: JWinslow23 on July 06, 2015, 12:36:23 AM
I've never upgraded my calc (I got it when the OS was 4.0), and the included backs work.
Title: Re: Bejeweled CSE
Post by: unknownloner on July 06, 2015, 01:03:13 AM
Quote from: DJ Omnimaga on July 05, 2015, 07:43:52 PM
Bug report: Background pictures don't work.

(https://img.ourl.ca/wabbitemu-7.png)

Looks fine to me!

JK, re-download the game. I re-uploaded with fixed backgrounds.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 06, 2015, 01:14:57 AM
Ok I'll do so. I was starting wondering what's up because I just upgraded to OS 4.2 now and still had the problem. Gonna try the new version soon.
Title: Re: Bejeweled CSE
Post by: alexgt on July 06, 2015, 02:05:42 PM
BTW my high score is ~500 then I had to eat dinner :P
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 06, 2015, 03:22:28 PM
On a side note, when I tried the game last time (the version with no background) the speed was not bad at all for basic. If it was a bit faster, it could almost be mistaken for some ASM game lol.
Title: Re: Bejeweled CSE
Post by: alexgt on July 06, 2015, 04:14:15 PM
Hey just increase the speed in wabbit :P
Title: Re: Bejeweled CSE
Post by: Unicorn on July 06, 2015, 09:58:58 PM
I first thought it was ASM from the first screenshots.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 07, 2015, 01:01:25 AM
Quote from: alexgt on July 06, 2015, 04:14:15 PM
Hey just increase the speed in wabbit :P
I do that when grinding in calculator RPGs :P

Anyway Unknownloner what would be nice is if there was a way to have multiple backgrounds at once on the same calc. If a background ID is missing, then it would just display a white background by default.
Title: Re: Bejeweled CSE
Post by: Unicorn on July 07, 2015, 01:13:55 AM
The only problem is how much space it would take up right? 8000 bytes a background, is it not?
Title: Re: Bejeweled CSE
Post by: unknownloner on July 07, 2015, 01:30:50 AM
It's like 12,000 bytes for a background. The main reason I didn't add it as a feature is that I didn't feel like programming it in. I may add it later if I get the urge to do so, but don't hold your breath :P.

In other news, I've finished my pure BASIC version. Once I get someone to test it on the CE for me to make sure it works there, I'll release it. It runs pretty well; the only problem it has on the CE is the same problem many other pure BASIC games have, which is small graphics.

The CSE version of the pure BASIC Bejeweled also has to flash the screen whenever it updates tiles, because of a well-known bug where Pt-On() will initially only draw black pixels for point types 3 and 4. The CE is unaffected by that bug, so the screen flash isn't present in that version either.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 07, 2015, 01:38:48 AM
Awesome to hear about the CE version. I am curious about what it looks like. I hope you keep a copy of the CSE version, though, for those who wants the enhanced graphics :)


And yeah I remember the Pt-On bug.


EDIT: By the way, I downloaded the new version on Cemetech and it still doesn't display any background. I run OS 4.2 D:
Title: Re: Bejeweled CSE
Post by: unknownloner on July 07, 2015, 05:51:00 AM
For anyone coming across this thread later, the issue was that DJ was using DoorsCSE 8.1 RC1, which had a bug in it that caused the backgrounds not to display properly.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 07, 2015, 01:12:26 PM
Yeah I thought that RC1 supported them since they were listed in the features. I didn't realize that I hadn't upgraded, though, since pretty much everything else worked and that Bejeweled is the only DCSE game that uses 32-color background pics.

I was really scared, though, because I feared it was one of those nasty hardware changes from TI like what happened with extra RAM pages a few years ago and prevented many programs from working anymore.
Title: Re: Bejeweled CSE
Post by: alexgt on July 07, 2015, 02:34:03 PM
I was using Doors 8.2 so I guess that was the issue :P
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 07, 2015, 03:16:47 PM
Wait, did you have issues in DCSE 8.2 too? Because for me everything works fine in it.
Title: Re: Bejeweled CSE
Post by: alexgt on July 07, 2015, 03:22:23 PM
No, I meant that that was the problem for you because I had 8.2 (working) and you had 8.1 and 8.1 wasn't working for Bejeweled :P
Title: Re: Bejeweled CSE
Post by: Unicorn on July 07, 2015, 09:04:10 PM
Yeah, I had the same type of issue using 8.1, when redisplaying a part of a background in Money Walrii.
Title: Re: Bejeweled CSE
Post by: JWinslow23 on July 09, 2015, 12:24:47 AM
Quote from: unknownloner on July 07, 2015, 01:30:50 AMIt's like 12,000 bytes for a background.

Using Celtic2CSE's det( 8 ) command, I have discovered that backgrounds (minus the headers and junk) are 12,039 bytes.

Quote from: unknownloner on July 07, 2015, 01:30:50 AMThe main reason I didn't add it as a feature is that I didn't feel like programming it in. I may add it later if I get the urge to do so, but don't hold your breath :P.

I whipped up something of my own that works for me. Here is the code (also with the other stuff around it for context). Just enter in the name of the appvar (but make sure you have a default background as well named BJWLBG). The only verifying it does is checking if the appvar exists, and checking the size :P
If 81>det([[20:Then
Disp "Get Doors CSE to run this:","http://dcs.cemetech.net
Return
End
ClrHome
Disp "Enter Background name:","(BJWLBG for default)
Input "",Str0
"rowSwap("+Str0→Str0
det(8
If sub(Str9,5,5)≠"12039
Then
Disp "Error: appvar not found or","otherwise invalid.","Using default background.
Pause "Press ENTER to play.
"rowSwap(BJWLBG→Str0
End
{8,8→dim([A]
Ans→dim([B]
real(0,1,1
real(0,2,1
"BJWLGEMS
real(5,0,0
real(8,1,0
real(9
sub(Str0,2,length(Str0)-1→Str0
real(5,7,0
real(7,7,23,23,114,66,31,0
real(7,9,24,24,112,64,0,0
"Options
real(6,0,44,32,255,0,0
real(7,9,44,40,56,1,255,0
real(4,0,0,0,5,2,0,0,248,0,0,16,17,18,19,20,21,22,23,24,25
real(8,1,0
Str0
real(5,7,0
real(7,7,48-2,24-2,68,68,31,0
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 09, 2015, 02:03:43 AM
Quote from: alexgt on July 07, 2015, 03:22:23 PM
No, I meant that that was the problem for you because I had 8.2 (working) and you had 8.1 and 8.1 wasn't working for Bejeweled :P
Oh I actually had 8.1 RC1 (I didn't notice I still had a release candidate at first), not 8.1. Were 32-color pics broken in 8.1 too?

Also JWinslow23 you should upload your custom backgrounds in a zip file and maybe screenshots of them
Title: Re: Bejeweled CSE
Post by: unknownloner on July 09, 2015, 02:05:12 AM
I use 8.1.2 and it works for me, so it wasnt broken in all versions of 8.1 at least.
Title: Re: Bejeweled CSE
Post by: JWinslow23 on July 09, 2015, 02:06:59 AM
Quote from: DJ Omnimaga on July 09, 2015, 02:03:43 AMAlso JWinslow23 you should upload your custom backgrounds in a zip file and maybe screenshots of them

I only have one "custom" background, one of me and my girlfriend on the 4th of July (if I look shirtless, don't worry, I'm actually wearing a blue tank top :P ). I'll just update Wabbitemu, I haven't updated it when it added +CSE support :P

EDIT: Here's my custom background (also, you get a peek at the loader :P )
(https://img.ourl.ca/BejeweledKelseyBG.gif)
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 09, 2015, 02:23:32 AM
Yeah I was wondering about the shirtlessness, lol. Anyway it seems like a bunch of backgrounds fit well. :)

Also in WabbitEmu, always increase the contrast to maximum when in CSE mode.
Title: Re: Bejeweled CSE
Post by: JWinslow23 on July 09, 2015, 02:24:44 AM
Quote from: DJ Omnimaga on July 09, 2015, 02:23:32 AM
Yeah I was wondering about the shirtlessness, lol. Anyway it seems like a bunch of backgrounds fit well. :)

Also in WabbitEmu, always increase the contrast to maximum when in CSE mode.
Noted. I wondered why it looked dull :P
Title: Re: Bejeweled CSE
Post by: Unicorn on July 09, 2015, 03:22:20 AM
If you CAN increase it. It sometimes lets you increase it, and other times it sticks low contrast :(
Title: Re: Bejeweled CSE [Hybric Basic]
Post by: JWinslow23 on July 09, 2015, 04:55:32 AM
And the .8xv is attached. If you wanna make your own, make a 160 pxl wide by 120 pixel tall image, put it in TokenIDE's Color Sprite Editor (make sure it's set to xLIBC) and save as a 32-color .8xv . If it's over 32 colors, it'll MAKE it 32 colors.
Title: Re: Bejeweled CSE
Post by: unknownloner on July 09, 2015, 08:26:55 PM
Quote from: Unicorn on July 09, 2015, 03:22:20 AM
If you CAN increase it. It sometimes lets you increase it, and other times it sticks low contrast :(

If it's stuck you can usually fix that by turning it off and back on again (like 2nd + On key, not restarting wabbit).
Title: Re: Bejeweled CSE
Post by: Unicorn on July 09, 2015, 10:30:35 PM
Quote from: unknownloner on July 09, 2015, 08:26:55 PM
Quote from: Unicorn on July 09, 2015, 03:22:20 AM
If you CAN increase it. It sometimes lets you increase it, and other times it sticks low contrast :(

If it's stuck you can usually fix that by turning it off and back on again (like 2nd + On key, not restarting wabbit).
I don't think that ever worked for me. Huh.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 10, 2015, 03:10:45 AM
Strange, I never had this problem. Also JWinslow23 I'll try your background soon. :)
Title: Re: Bejeweled CSE
Post by: JWinslow23 on July 10, 2015, 03:22:20 PM
Quote from: DJ Omnimaga on July 10, 2015, 03:10:45 AM
Strange, I never had this problem. Also JWinslow23 I'll try your background soon. :)
Heheh.
Title: Re: Bejeweled CSE
Post by: Unicorn on July 10, 2015, 04:53:02 PM
Quote from: DJ Omnimaga on July 10, 2015, 03:10:45 AM
Strange, I never had this problem. Also JWinslow23 I'll try your background soon. :)
Someone else had it on cemetech, so I know its not me. Anyways, it doesn't matter that much to me.
Title: Re: Bejeweled CSE
Post by: unknownloner on July 19, 2015, 08:39:28 AM
File updated on cemetech with a bugfix in the game-over checking, and numerous speed increases throughought the program. Check it out!
Title: Re: Bejeweled CSE
Post by: JWinslow23 on July 19, 2015, 06:11:21 PM
Quote from: unknownloner on July 19, 2015, 08:39:28 AM
File updated on cemetech with a bugfix in the game-over checking, and numerous speed increases throughought the program. Check it out!
Sweet. Did you add my custom background hack? Or, will you?
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 19, 2015, 06:13:40 PM
Quote from: unknownloner on July 19, 2015, 08:39:28 AM
File updated on cemetech with a bugfix in the game-over checking, and numerous speed increases throughought the program. Check it out!
Ok I'll update my copy soon :)
Title: Re: Bejeweled CSE
Post by: Unicorn on July 19, 2015, 06:35:13 PM
Me to, did you look at that bug report I submitted in Cemetech? The jewels didn't display correctly. I think I have DCSE 8.2
Title: Re: Bejeweled CSE
Post by: unknownloner on July 19, 2015, 07:47:28 PM
@Unicorn I saw your post but there's nothing I can do about that. sounds like a xlibc bug. I'd say try deleting and resending the file. you mentioned you resent it but not if you deleted the old one first. also if you edited the games code at all you could have accidentally messed up the tile loading code
Title: Re: Bejeweled CSE
Post by: Unicorn on July 20, 2015, 01:42:26 AM
I didn't edit the code ever. But, I just played it today, again, and it worked. So it may have been another program that caused the bug.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 21, 2015, 05:39:59 AM
Sometimes it's just DCS acting up after numerous misuses or running some incompatible programs (such as AssemblyBandit games). A RAM clear and sometimes deleting the DCS8 appvars before the reset often fixes the issue.
Title: Re: Bejeweled CSE
Post by: Unicorn on July 21, 2015, 11:16:07 AM
Quote from: DJ Omnimaga on July 21, 2015, 05:39:59 AM
Sometimes it's just DCS acting up after numerous misuses or running some incompatible programs (such as AssemblyBandit games). A RAM clear and sometimes deleting the DCS8 appvars before the reset often fixes the issue.
True, I did a RAM clear recently, that may have been it :)
Title: Re: Bejeweled CSE
Post by: alexgt on July 22, 2015, 03:06:19 PM
I remember whn I didn't know you could archive programs on my 84+ and the first ram clear was when I was coding a zelda home-screens clone, I was so mad :P
Title: Re: Bejeweled CSE
Post by: Unicorn on July 22, 2015, 03:07:21 PM
Quote from: alexgt on July 22, 2015, 03:06:19 PM
I remember whn I didn't know you could archive programs on my 84+ and the first ram clear was when I was coding a zelda home-screens clone, I was so mad :P
Oh, that sucks. At least Doors CS removes that problem usually. Its not a pain to run programs anymore :)
Title: Re: Bejeweled CSE
Post by: alexgt on July 22, 2015, 03:09:10 PM
Don't worry that broke some really bad coding habits :P
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 30, 2015, 04:15:48 PM
YEah data losses like this always suck. That said, even if your stuff is archived it's still a good idea to back up often because your archive can corrupt. (which happened to me with Illusiat 2002)
Title: Re: Bejeweled CSE
Post by: Unicorn on July 30, 2015, 06:53:43 PM
Quote from: DJ Omnimaga on July 30, 2015, 04:15:48 PM
YEah data losses like this always suck. That said, even if your stuff is archived it's still a good idea to back up often because your archive can corrupt. (which happened to me with Illusiat 2002)
Yup, I had that happen a few times after playing an ASM game. (I had backed up the day before luckily)
Title: Re: [TI-84+CSE] Bejeweled CSE [Hybric Basic]
Post by: Snektron on July 31, 2015, 10:00:37 AM
The stuff i make on my calc are always just tests anyway, real big projects i always do on PC.
(also: axe's backup function)
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on July 31, 2015, 05:36:33 PM
Does the latter work 100% of the time though? A few years ago, Axe's backup function sometimes did the complete opposite of what it was supposed to do: It deleted the entire project instead of backing it up. (kinda like BrandonW's fake reset program that actually reseted the RAM for real)
Title: Re: Bejeweled CSE
Post by: Unicorn on July 31, 2015, 05:56:56 PM
Quote from: DJ Omnimaga on July 31, 2015, 05:36:33 PM
Does the latter work 100% of the time though? A few years ago, Axe's backup function sometimes did the complete opposite of what it was supposed to do: It deleted the entire project instead of backing it up. (kinda like BrandonW's fake reset program that actually reseted the RAM for real)
lol, I be that was fixed quickly.
Title: Re: Bejeweled CSE
Post by: Snektron on August 01, 2015, 05:58:22 PM
Quote from: DJ Omnimaga on July 31, 2015, 05:36:33 PM
Does the latter work 100% of the time though? A few years ago, Axe's backup function sometimes did the complete opposite of what it was supposed to do: It deleted the entire project instead of backing it up. (kinda like BrandonW's fake reset program that actually reseted the RAM for real)

I use Axe 1.2.2 on my calc and i've never had any problems with the backup function
inb4 jinx
Title: Re: Bejeweled CSE
Post by: Unicorn on August 02, 2015, 06:09:44 AM
I never figured axe out. Maybe I should see what I can do with it now. Or maybe I souls finish my current projects. :P
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on August 10, 2015, 03:36:17 AM
THe bug was fixed but it took several versions IIRC.
Title: Re: Bejeweled CSE
Post by: unknownloner on June 29, 2016, 06:09:24 AM
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.

https://www.youtube.com/watch?v=nhCjIun-_g8

Sorry about the breathing BTW, didn't realize it was so loud!
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on June 29, 2016, 06:17:59 AM
Wow the speed is very nice for BASIC. I'm surprised actually, given the fact that full squares are displayed. Do you use a separate pt-on command per chunk rather than For loops? I often found that this is faster, although much larger. Good job so far :)
Title: Re: Bejeweled CSE
Post by: unknownloner on June 29, 2016, 06:22:30 AM
Yeah I use 4 separate Pt-On commands per tile.

I was originally doing 8 per tile and filling the entire tile with color, but that ended up being too slow
to be playable. I also found a way using 5 Pt-On's that let me do fully-filled 11x11 tiles, but I still
wanted the tiles to be bigger (and it was still a bit too slow). On the bright side, it made the method
for displaying the cursor an easy choice, so I didn't have to think too hard about how to do that. It's
just another 4 Pt-On(s, but with a different point type.
Title: Re: [TI-84+CSE] Bejeweled CSE [Hybric Basic]
Post by: JWinslow23 on June 29, 2016, 07:23:24 AM
Awesome that this is coming to the CE! Nice work, it's fast already!

Oh, and if you want a different, much faster game-over check, perhaps you can borrow the code in my 84+ version...of course, it's not my code (I'm not that clever :P ), it's lirtosiast's, so ask him over on Cemetech if you like.

Here is the post on Cemetech (https://www.cemetech.net/forum/viewtopic.php?p=237413#237413), if you're not sure what I'm talking about.
Title: Re: Bejeweled CSE
Post by: Dream of Omnimaga on June 29, 2016, 04:31:07 PM
Quote from: unknownloner on June 29, 2016, 06:22:30 AM
Yeah I use 4 separate Pt-On commands per tile.

I was originally doing 8 per tile and filling the entire tile with color, but that ended up being too slow
to be playable. I also found a way using 5 Pt-On's that let me do fully-filled 11x11 tiles, but I still
wanted the tiles to be bigger (and it was still a bit too slow). On the bright side, it made the method
for displaying the cursor an easy choice, so I didn't have to think too hard about how to do that. It's
just another 4 Pt-On(s, but with a different point type.
I see. I had an hard time telling if you used 4 or 9 commands because the video quality was low on my phone for some reasons.  This still shows that we can make somewhat fast games in pure TI-BASIC. :)