Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Darl181 on January 24, 2012, 10:07:40 pm

Title: Switch
Post by: Darl181 on January 24, 2012, 10:07:40 pm
(split from YAMGT (http://ourl.ca/8025), a whole page is kind of big for a minigame :P)

Just now realized I never posted LightOff, the game that came just before Tio.  In fact it was originally called Tio. :P
So I fixed up the source a bit so it'll compile with the later versions of Axe (it's at least a year old XD), screenied and now yay.

Iirc at one point I got it working with grayscale...I'll have to remember how I did that.


I'm pretty sure one can get the mechanic of the game watching the screenie.  You try to turn off all the "lights" (squares).
Arrow keys move, Clear quits.

Edit: also brought the index in the first post up-to-date, it was missing projects from other threads.
Title: Re: Switch
Post by: Darl181 on January 26, 2012, 02:26:36 pm
Got it :)
Also did some aesthetic stuff.

The only problem is, some games are impossible to finish because you can't turn off one single light (at least, one gray light, haven't run into one white light yet)

Put in a fix, it doesn't prevent the problem but it detects when the problem's there and automatically ends the game when appropriate. ;D
Title: Re: Switch
Post by: Deep Toaster on January 26, 2012, 10:36:22 pm
Yay, you're doing minigames again :D

LightsOut looks fun (and impossible to solve O.O). Original idea?

By the way, I think you can make sure the levels you're generating are always possible by starting with a solved slate and working backwards.
Title: Re: Switch
Post by: Darl181 on January 26, 2012, 11:06:20 pm
Iirc the original idea came when I was screwing with a sprite editor and bugged it, to similar results :P

I've been thinking, because I've been kind of de-motivated with SCB fsr so maybe I could clean up some of the old games, ReadmeRoll and put them on ticalc and omni :)
(hopefully coming back to SCB afterwards to make some more progress ofc)
Title: Re: Switch
Post by: Deep Toaster on January 27, 2012, 07:42:58 pm
It's always nice to take a break from the big projects and finish up some stuff here and there :)
Title: Re: Switch
Post by: Darl181 on January 27, 2012, 07:50:30 pm
It sure is :)

I'm putting together a readme for LightOut, and am getting some ideas...
Just need to see how hard it is to implement 2-, 3- and 4-scale as different difficulties then optimize the whole thing for size.
Also getting menu ideas ^.^


Edit: just searched ticalc and wow there's a whole slew of programs named light out :crazy:
Looking for a unique name, tho maybe "Switch" will do?

Edit2: don't see any/many so Switch it is :D
Title: Re: Switch
Post by: Darl181 on January 28, 2012, 02:05:36 pm
...and a menu concept.  Yes, the scores are random :P
At first I was doing some vanilla menu with Easy, Medium and Hard but then this came to mind, playing on the light concept.

Also, watch the word on top ;)
Title: Re: Switch
Post by: Nick on January 28, 2012, 04:41:03 pm
wow, it changes the greyscale too (the title), very nice :) and it's very original to make a difficulty setting like this one, it's special.. really great
Title: Re: Switch
Post by: kindermoumoute on January 28, 2012, 04:51:15 pm
It takes too long to finish the screen. :/
Title: Re: Switch
Post by: Darl181 on January 28, 2012, 04:54:26 pm
Yeah, I'm planning on doing different types.  Black/white (such as a few replies back) shouldn't take very long, but I kind of designed the other to be a puzzle game that would take a while to finish. ;)

Edit: I guess it's worth mentioning that I plan on having the three different types in one game, tho the menu already shows that. :P
Title: Re: Switch
Post by: Darl181 on January 29, 2012, 08:01:07 pm
Ok so here's a sort of beta, tho not much that you haven't seen already.
There's some debugging stuff, such as when you hold 2nd in-game and a couple other things.  Don't feel like taking them out just yet :P

Before ticalc I need to do a few more things:
 - Fix remnants of weird program flow  (done)
 - Pause (done)
 - [+]/[-] change contrast (done)
 - More elaborate message than just "WIN" at the end (done)
 - HighScore saving, plan on having archived appvar (done)
 - possibly name w/ score as well?
 - Some way to save the current game (done)
 - Teacher Key (done)
 - Readme (done)
 - Possibly optimize for size (done)
Title: Re: Switch
Post by: Darl181 on January 30, 2012, 09:50:45 pm
So I've been playing around with the sprites a bit, and now I'm not sure which one I like better...
The only difference between them is the two sprites (light and selector), everything else is the same.

Edit: figured I may as well post a beta to go with the screenie.  So...

All new controls are in-game
Mode==pause
+ / -==change contrast
clear==quit
2nd==debug stuff I still haven't taken out
Alpha==also debug?  idk, it slows down the program to show scanlines

The exec has the 3*3 sprites I'm thinking about, you can prolly find the part in the source where you move the comment block dots to use the old ones :P
Speaking of which I went through and commented some stuff in the source.

Also shiny Paused/You Win things.

Title: Re: Switch
Post by: kindermoumoute on January 31, 2012, 11:48:33 am
Black screen. I can't leave the program. :/
Title: Re: Switch
Post by: Darl181 on January 31, 2012, 02:20:22 pm
At what part are you getting the black screen?  Did it change the contrast or something?
Title: Re: Switch
Post by: Darl181 on February 01, 2012, 12:08:28 pm
Got game saving and High score saving working last night.  Still testing to see if I can trigger any bugs :P

I think I got what was the darkened screen, I'm not exactly sure why but I'm thinking the part where it gets the contrast level was skipped somehow, leaving some weird value in the variable I have it Shade() to.
Title: Re: Switch
Post by: Darl181 on February 02, 2012, 08:53:08 pm
Ok, I've been testing this on and off throughout the day and haven't found any bugs, so beta time.
Only thing I'm not too fond of is how long it takes to archive the scores appvar at the end, but I haven't spent too much on that as of yet.

Haven't gotten to optimizing yet, I'll prolly have to do it on the comp because of how the flow works but I've done...
 - Best Score saving (the lower the better)
 - Game saving
 - Teacher key

The teacher key works just like a normal pause, except it turns the screen off using s Shade(0).  Pressing [On] would quit the game, return to the homescreen and then turn on the screen as if the calc had APD'd or something.

Tentatively added controls:
 [Del] Save game and quit
 [Stat] Teacher key
 [^] Return to main menu
While Paused:
 [On]/[Clear] Quit without saving
 [Del] Save and quit
 [Mode]/[Stat] Continue

No real aesthetic changes other than going back to the old sprites, so just the 8xps this time.

Edit: In case you didn't notice I split this off the YAMGT thread, a whole page is kind of big for a "minigame" :P
Title: Re: Switch
Post by: Darl181 on February 14, 2012, 10:40:06 pm
Atm it's at 5621 bytes according to the mem menu, and I'm attempting to optimize it for size.  Haven't done this for a while so we'll see how it goes :P
http://piratepad.net/Switch
Title: Re: Switch
Post by: hellninjas on February 15, 2012, 03:39:42 pm
I...Can't...just...one...more...light...GAH!
Cool minigamezorz!
Title: Re: Switch
Post by: DJ Omnimaga on February 15, 2012, 03:55:16 pm
Any screenshots?
Title: Re: Switch
Post by: Darl181 on February 15, 2012, 06:27:45 pm
Any screenshots?
Not really any graphic changes in the latest version, so I'll re-post a few old screenshots ;)
(http://www.omnimaga.org/index.php?action=dlattach;topic=12493.0;attach=11496;image) (http://www.omnimaga.org/index.php?action=dlattach;topic=12493.0;attach=11516;image) (http://www.omnimaga.org/index.php?action=dlattach;topic=12493.0;attach=11460;image)

Still optimizing here and there, tho the etherpad's largely untouched :P  The part that seems to be taking up the most space is the level generation and the graphics manipulation when a light gets toggled or changed (especially in 4-scale) so I'm working on some way to have it reference a GDB rather than a dozen-plus If statements :/

I...Can't...just...one...more...light...GAH!
I made it so the game ends if the total value of the lights is equal to the currently selected light, so it should automatically end if there's just one last unsolvable one.  Did you mess with the light a bit, putting the selector over it and etc?
Title: Re: Switch
Post by: DJ Omnimaga on February 15, 2012, 11:41:33 pm
Oh wait earlier I didn't notice I was on a 2nd page so I missed the other screenshots ???. My bad lol.

This looks awesome O.O. I wonder if it's very hard though since there are so many lights lol
Title: Re: Switch
Post by: Darl181 on February 22, 2012, 11:02:45 am
for those who got here from the link in my sig, screenies above

Well, at least in my experience it hasn't been really hard once you got the gist of it.  It's just kind of time-consuming, which is what I was going for in the first place ;D

Also optimized ~300 bytes off the exec by putting the big text-drawing stuff in a sub, because it's used three times.  The old code's still there in comment blocks tho :P
I think there's still a bug where high scores are saved but aren't displayed immediately after in the main "menu," I'm looking into that.  Afaict it's because the main menu looks to the archive for the stored scores, and while the program's open I think it's kept in the ram.

Edit: I'm looking at the code in a piratepad; the var's kept in archive and is unarchived to store the high score to, and archived just after.  I guess it'll be fixed by doing a GetCalc() again.
Edit2: Fixed ;D and re-uploaded.
Title: Re: Switch
Post by: aeTIos on February 22, 2012, 12:32:32 pm
WTF Y U STEAL MAH GAME IDEA
Title: Re: Switch
Post by: Darl181 on February 22, 2012, 12:52:38 pm
Well I had this idea more than a year ago (https://http://ourl.ca/8025/170551), it's just recently that I expanded on it.
Title: Re: Switch
Post by: Darl181 on February 25, 2012, 12:38:27 pm
Added download in Omni archives (http://www.omnimaga.org/index.php?action=downloads;sa=view;down=783), also pending on ticalc.org (http://www.ticalc.org/archives/files/fileinfo/445/44598.html) ;D

Gimp took some obnoxious liberties when animating the first two screenshots, so they're kind of screwed up :|

Also I have no idea how the _noshell got to be only 76 bytes 0.o
Title: Re: Switch
Post by: LincolnB on February 25, 2012, 09:36:20 pm
wow aeTIos, haha you know this isn't exactly an original idea? No offense intended Darl, this is a really good implementation of an age-old idea.
Title: Re: Switch
Post by: Darl181 on February 27, 2012, 08:07:54 pm
The same night I submitted Switch to ticalc, I went into the source and found a way to optimize out ~200 bytes.  So...

Update.  As well as the smaller file size there's a few things fixed, such as saved games being continuously reloaded until the program closes and the behavior of the menu when you return to it.
Also put together two screenies that I designed to go next to each other in the first place.
(readme and other-shell-compatible programs in the zip)
Title: Re: Switch
Post by: aeTIos on March 09, 2012, 05:08:34 pm
wow aeTIos, haha you know this isn't exactly an original idea? No offense intended Darl, this is a really good implementation of an age-old idea.

Yes actually I know.
And wow, someone rated me down on that post, it wasn't intended offensive, more jokingly.
Also darl, that looks very good, better than I could do.
Title: Re: Switch
Post by: parserp on March 09, 2012, 05:10:01 pm
wow aeTIos, haha you know this isn't exactly an original idea? No offense intended Darl, this is a really good implementation of an age-old idea.

Yes actually I know.
And wow, someone rated me down on that post, it wasn't intended offensive, more jokingly.
Also darl, that looks very good, better than I could do.
I got your back. ;)
Title: Re: Switch
Post by: aeTIos on March 09, 2012, 05:14:11 pm
OK, I found it actually no problem if someone voted me down on that post, after all its a personal choice. But thanks for getting me back :)
Title: Re: Switch
Post by: parserp on March 09, 2012, 05:14:47 pm
OK, I found it actually no problem if someone voted me down on that post, after all its a personal choice. But thanks for getting me back :)
na prob :)
Title: Re: Switch
Post by: Darl181 on May 20, 2012, 02:44:16 pm
Got it smaller (and prolly faster) by switching from bitwise stuff to addition.
It seems to be working fine, tho I haven't tested it too much.

Source and ion exec attached.