Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: ztrumpet on June 16, 2010, 02:51:24 pm

Title: Axe Snake
Post by: ztrumpet on June 16, 2010, 02:51:24 pm
Over the past couple of days I've tried to make a 3 level grayscale game in Axe.  It's completely done, except when you get a highscore and need to type your name.  There it freezes.  Can anyone help me with this problem?

(It appears that getKey always returns a 0) :(

Thanks! ;D

note:  The grayscale's a lot better on calc... :D
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 16, 2010, 02:58:10 pm
Hey this looks nice except the screenshot doesn't appear to show any grayscale except to the first 24 or so columns of the screen ??? . Also , sorry to hear about the freezing problem, though :(
Title: Re: Axe Snake
Post by: ztrumpet on June 16, 2010, 02:59:19 pm
Hey this looks nice except the screenshot doesn't appear to show any grayscale except to the first 24 or so columns of the screen ???
Thanks. :)
It's because I didn't set Wabbit up right and since this isn't the final release it doesn't matter as much to me if it looks how it should. :D
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 16, 2010, 03:02:02 pm
Oooh ok lol, I thought it was a glitch or something. Btw I just played fastest speed and it was insane :O

EDIT: screenshot
Title: Re: Axe Snake
Post by: SirCmpwn on June 16, 2010, 03:17:47 pm
*cough* looks familiar *cough*
j/k, I can take a look at the highscore part later.
Title: Re: Axe Snake
Post by: ztrumpet on June 16, 2010, 03:20:04 pm
*cough* looks familiar *cough*
j/k, I can take a look at the highscore part later.
I just wanted to make a snake game, even though I already knew you had a cool one, sir. ;D

Oooh ok lol, I thought it was a glitch or something. Btw I just played fastest speed and it was insane :O
Huh.  That looks like it's at 15mhz even though there's no Full command...
Wow, that's fast! :D
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 16, 2010, 03:42:59 pm
At 15 MHz it would look more like this, altough it wouldn't work well on all 15 Mhz calcs (due to the grayscale requiring 6 MHz mode to show up properly on real hardware, according to Quigibo)
Title: Re: Axe Snake
Post by: nemo on June 16, 2010, 03:44:58 pm
i had the same problem with getKey always returning 0 once. try to slow down your program, put like Pause 100 before the getKey and see if it registers. that worked for me.
Title: Re: Axe Snake
Post by: SirCmpwn on June 16, 2010, 03:50:30 pm
Does your program use Pause to slow down the game on the slower modes?
Title: Re: Axe Snake
Post by: Quigibo on June 16, 2010, 05:06:34 pm
When 0.3.0 is released tonight (hopefully), I think the grayscale will look a lot better since I improved both of the routines.  Not only does it look better on real hardware, but also it seems to finally be in sync with wabbit settings.  Much thanks again to calc84maniac.
Title: Re: Axe Snake
Post by: Ikkerens on June 16, 2010, 05:12:57 pm
When 0.3.0 is released tonight (hopefully), I think the grayscale will look a lot better since I improved both of the routines.  Not only does it look better on real hardware, but also it seems to finally be in sync with wabbit settings.  Much thanks again to calc84maniac.

*offtopic Have I already told you how much I love you? :P
Title: Re: Axe Snake
Post by: meishe91 on June 16, 2010, 05:17:22 pm
When 0.3.0 is released tonight (hopefully), I think the grayscale will look a lot better since I improved both of the routines.  Not only does it look better on real hardware, but also it seems to finally be in sync with wabbit settings.  Much thanks again to calc84maniac.

Will it look equally good in both 6 and 15 MHz mode? Or still just 6 MHz?
Title: Re: Axe Snake
Post by: calcdude84se on June 16, 2010, 05:19:15 pm
IIRC it's still 6MHz mode only.
Title: Re: Axe Snake
Post by: ztrumpet on June 16, 2010, 07:10:14 pm
Does your program use Pause to slow down the game on the slower modes?
No, it just runs through the greyscale command in a for loop to make it look better.  :D

i had the same problem with getKey always returning 0 once. try to slow down your program, put like Pause 100 before the getKey and see if it registers. that worked for me.
Awesome idea!  I think I'll try that! ;D thanks! ^-^
Edit: That didn't work. :(  Do you have any more ideas? :)
Title: Re: Axe Snake
Post by: nemo on June 16, 2010, 07:24:31 pm
i'm sorry i don't, i checked my axe entry's menu and putting a Pause 50 before the getKey->K worked. are you using getKey like this

Code: [Select]
Pause 50
X+(getKey=3)-(getKey=2)->X
or like this:
Code: [Select]
Pause 50
getKey->K
X+(K=3)-(K=2)->X
because the first one didn't work for me, and then i switched to the second and it works.

Title: Re: Axe Snake
Post by: Quigibo on June 16, 2010, 07:34:46 pm
You shouldn't be using the normal getkey for games.  Its slow and it returns funky stuff sometimes.  That code should be:

Code: [Select]
Pause 50
X+getKey(3)-getKey(2)->X
Title: Re: Axe Snake
Post by: ztrumpet on June 16, 2010, 07:39:40 pm
I'm using it to get input for the user to type their name, so I don't want a lot of statements.  I pretty much need getKey to use with my look up table.
Nemo, I'm using it the second way.  Still no luck. =(
Title: Re: Axe Snake
Post by: nemo on June 16, 2010, 07:43:08 pm
quigibo, the BASIC way of getkey functions better for a menu. at least, for me it does. with yours it has the possibility of skipping an item. and if i increase the pause, my menu just looks like it's responding ridiculously slow.

sorry ztrumpet  :-\ i don't have anything else, except maybe quigibo's way will work. i suggest upping the pause to about 200-250 though, since 50 you have to deliberately try to not skip the middle item(s) in your menu

EDIT: offtopic, quigibo, are sine, cosine and the signed division routine really slow or did i accidentally put a delay in my program?
Title: Re: Axe Snake
Post by: Quigibo on June 16, 2010, 07:59:24 pm
Yeah, I wasn't sure if this was for a menu or part of the game.  Regular getkey is definitely good for menus.

Signed division is definitely the slowest of the 3.  The reason the circle looks a little square-ish is that I'm using a very fast approximation of sine and cosine for performance reasons.  Normally you don't notice it at all unless you draw the trail of the sprite.
Title: Re: Axe Snake
Post by: nemo on June 16, 2010, 08:05:10 pm
 :-\ alright. i'm only doing two signed divisions, two sines and two cosines and that section of my program is already as slow as the other which calls a subroutine 6 times for tilemap collision detection, and then has a volley of if statements to determine what to do. if there's any way to improve the signed division routine, that would be excellent. seeing as i don't even know what parsing actually does, i'm not exactly in a position to talk
Title: Re: Axe Snake
Post by: ztrumpet on June 16, 2010, 09:41:00 pm
I've confirmed that adding
Output(6)
Disp B>Dec
right after the getKey always returns a zero. :(
Title: Re: Axe Snake
Post by: Quigibo on June 17, 2010, 12:38:17 am
You didn't disable intterupts did you?  They are required for getkey.
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 17, 2010, 03:29:06 am
interrupts? Do you mean we must do FnOn at the start of our programs to be able to use getkey() now?
Title: Re: Axe Snake
Post by: Quigibo on June 17, 2010, 03:36:05 am
No, they're enabled by default.  You just shouldn't call fnOff without enabling it again if you plan to use OS getkey
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 17, 2010, 04:15:07 am
Oh ok. By OS getkey you mean getkey without the (), right?
Title: Re: Axe Snake
Post by: Quigibo on June 17, 2010, 04:18:16 am
Correct
Title: Re: Axe Snake
Post by: ztrumpet on June 23, 2010, 10:50:40 am
There are no FnOffs in the program. :(
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 23, 2010, 11:22:53 am
Could you maybe post your code via Quigibo PMs in case this might be a bug?
Title: Re: Axe Snake
Post by: ztrumpet on June 23, 2010, 11:26:30 am
The code's in the first post, in program form.  To clarify, this is NOT a contest entry. :)
Title: Re: Axe Snake
Post by: DJ Omnimaga on June 23, 2010, 11:27:02 am
Oh ok I thought this was the executable, I must have forgotten x.x
Title: Re: Axe Snake
Post by: ztrumpet on July 01, 2010, 10:15:57 pm
Yes!  I found and fixed the problem!  Tomorrow I'll upload the finished (and final) version. ;D
Title: Re: Axe Snake
Post by: Madskillz on July 02, 2010, 01:03:32 am
Hmmm....The game ran great when I got to it, however the text was all jumbled in the menu and then once I died the score was all jumbled. I ran this on an 84+ SE...did anybody else have this problem. This is my first time checking out Axe and any Axe game, I plan to go through some other games to see if it is an issue will all the axe games I try.
Title: Re: Axe Snake
Post by: Quigibo on July 02, 2010, 01:40:55 am
I tried compiling the program from the first post with 0.3.2 and all the text seemed fine on my 83+SE emu and on an 84+ except for when it froze at the high score menu.  Is it possible there were some text flags that were changed before the program was run?  Also what shell did you use to compile/run the program?  Or did you just use the executable he provided?
Title: Re: Axe Snake
Post by: DJ Omnimaga on July 02, 2010, 01:43:41 am
Nice to see it fixed Ztrumpet. What was the issue?
Title: Re: Axe Snake
Post by: ztrumpet on July 02, 2010, 12:43:01 pm
Nice to see it fixed Ztrumpet. What was the issue?
I had something like {L1+C} when it should have been {L1+C+B}. :P
Title: Re: Axe Snake
Post by: Madskillz on July 02, 2010, 12:53:55 pm
I used Axe Parser 0.3.1
I tried compiling without a shell and then with mirage and both provided the same results. I will try version 3.2
Title: Re: Axe Snake
Post by: ztrumpet on July 02, 2010, 05:16:45 pm
Here's the finished version.  I'll probably write a readme later, but all you really need to know is this:
prgmA is the source.
prgmAXESNAKE is compiled for Ion using 0.3.2. :)
It creates the AppVar AxeSnake to save your high scores.  If you've archived the AppVar, it will put it back in archive. ;D

This is just like snake, only it's made in Axe with 3 level greyscale.  Enjoy! ;D

Oh, and I recorded it at a pretty low framerate, so that's why it doesn't look as well as it does on calc. :D
Title: Re: Axe Snake
Post by: DJ Omnimaga on July 02, 2010, 05:20:26 pm
Wow nice! You should put it in the downloads section. (in a zip file, of course) I'm glad you got the bug fixed too. Looks nice as always :)
Title: Re: Axe Snake
Post by: Madskillz on July 02, 2010, 05:58:22 pm
The new version works fine on my calc now. Everything seems fine now. Nicely done Ztrumpet!
Title: Re: Axe Snake
Post by: Builderboy on July 02, 2010, 08:57:34 pm
Excelent version of snake :) it's cool how we now have these actual finished games that are being released writen in his awesome language.  Good job!
Title: Re: Axe Snake
Post by: ztrumpet on August 04, 2010, 02:21:32 pm
Alright, here's the gif I'm using for the official release. :)

Within 10 minutes it will be uploaded here, and within 15 minutes it will be in ticalc's queue. ;D

edit: http://www.omnimaga.org/index.php?action=downloads;sa=view;down=541
Title: Re: Axe Snake
Post by: DJ Omnimaga on August 04, 2010, 06:36:08 pm
Nice screenshot ^^

Also although I haven't played the game much lately, I loved it when I tried it (which happened often). One of the best looking snake games for calc
Title: Re: Axe Snake
Post by: Munchor on October 28, 2010, 03:10:56 pm
Thx much love the game
Title: Re: Axe Snake
Post by: ASHBAD_ALVIN on October 28, 2010, 03:14:00 pm
^ slight necropost above :D ^

But yeah, it does look very nice, and I really love the game even though it's really simple
Title: Re: Axe Snake
Post by: ztrumpet on October 28, 2010, 05:56:40 pm
Thanks! ;D  I'm glad you guys like it. :)