CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: matrefeytontias on December 21, 2014, 10:18:21 PM

Title: Axagon
Post by: matrefeytontias on December 21, 2014, 10:18:21 PM
Hi,

It's been a while since I last worked on an Axe project because school kept me busy and non-motivated, but since it's the holidays, I thought of getting back into it.

I'm not getting straight back into Worms (I will, later) because I wanted to do a quick little project before, and that had to be Hexagon. Note that I'll only do Hexagon, not Super Hexagon.

Screenshots coming soon, at the time of writing everything has been done except collisions and patterns after 3 hours worth of programming. The game runs smoothly at 6 MHz as always.
Title: Re: Axagon
Post by: Keoni29 on December 21, 2014, 10:49:42 PM
Quick projects can be the most rewarding ones. I like to finish making games and who doesn't.
Title: Re: Axagon
Post by: Dream of Omnimaga on December 22, 2014, 12:33:15 AM
Hexagon would be cool for Z80 calcs. :) There is one already called Super Square or something but it doesn't even look close to hexagon.
Title: Re: Axagon
Post by: matrefeytontias on December 22, 2014, 12:13:26 PM
There you go, screenshot of it running at 6 MHz (as always, but I have to re-lose the habit of saying it everytime :P).

(https://img.ourl.ca/axagon1.gif)

Also, you don't see it on the screenshot because it's randomized, but the rotation changes direction randomly (it will also change speed).

EDIT : oops, you actually see it :P
Title: Re: Axagon
Post by: Dream of Omnimaga on December 22, 2014, 12:25:57 PM
Oooh pretty nifty so far. Glad you got rotation working by the way. That was the main feature the CSE version lacked. :D
Title: Re: Axagon
Post by: matrefeytontias on December 22, 2014, 12:28:06 PM
Yeah, I was thinking how I'd do that without a polygon filling routine (as I was pretty sure the poor 83+ wouldn't handle it), so I thought of giving up on filling surfaces and going full lines. It works rather nicely, but I'm worried about how it will look like with many obstacles.
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 22, 2014, 03:09:29 PM
I have the same thing running on Casio Fx-9860. it runs quite fast until multiple obstacles are there and the fps sinks down...
Title: Re: Axagon
Post by: pimathbrainiac on December 22, 2014, 04:50:50 PM
Great job man! I was thinking about doing this, actually. Nice to see you beat me to the punch!
Title: Re: Axagon
Post by: aetios on December 22, 2014, 09:15:21 PM
That looks great!
Title: Re: Axagon
Post by: matrefeytontias on December 23, 2014, 11:30:37 AM
Alright, now that complex patterns are nicely supported and easy to add at will, the only things left are collisions and a proper menu !

(https://img.ourl.ca/axagon2.gif)
Title: Re: Axagon
Post by: Dream of Omnimaga on December 23, 2014, 12:06:24 PM
Holy hell that gets quite insane near the end! O.O

I also notice the lines are not as thick. Was it done for speed?
Title: Re: Axagon
Post by: pimathbrainiac on December 23, 2014, 03:17:22 PM
Looks nice! Will the collisions be handled as pixel perfects or some other way?
Title: Re: Axagon
Post by: matrefeytontias on December 23, 2014, 05:54:17 PM
DJ: yeah, I reduced the thickness so I have less lines to draw.

pimath: I use the fact that the player's coordinates are polar to make collision detection easy: when the obstacle's R coordinate is close enough to the player's (which is a constant), just compare the angles of the player and each side of the obstacle.
Title: Re: Axagon
Post by: pimathbrainiac on December 23, 2014, 05:58:48 PM
Ah okay the polar coordinate system makes sense. I was thinking about that when I almost started this as a project, but I wasn't thinking about collisions.
Title: Re: Axagon
Post by: Dream of Omnimaga on December 23, 2014, 08:55:19 PM
I never did 3D and rotation, so I would probably have an hard time porting this game to the HP Prime or CSE in short terms, but maybe if I ever learn them, I could manage to do it. For the HP Prime version I could use actual polygon commands since they're filled and just change the colors gradually without speed loss.
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 23, 2014, 09:14:16 PM
DJ O, just make the rotations, the pesudo perspective can be done with some tweaks to the simple formulas (I should find them again. I lost them)
Title: Re: Axagon
Post by: Dream of Omnimaga on December 23, 2014, 09:37:48 PM
Yeah it's the formulas that I am missing actually, plus getting collision done would probably require me to learn about polar coordinates and that stuff anyway.

Also I wonder how hard it is to use polar coordinates that are pixel-based instead of Window-based, because on the Prime I prefer to work in pixel mode to avoid changing user's window settings (people didn't care in the 90's and early 2000's but nowadays whenever a program does it they bitch and moan about it like if it was worse than Custer's Revenge).
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 23, 2014, 10:46:38 PM
Actually, collisions on this game is stupidly easy and not touching any polar coordonate stuff:

Let's say that your current angle is in [0, 360] (I like degres), in Hexagon, you have six sides, so you're on the side a/360.
For the obstacle, you have just its side, its length(depth) and it's time.  Once it reaches the center hexagon (after a certain time), if your angle is in this side, game over. If you want to have Super-Hexagon-esque collisions, you just check at the meeting the death, and to stop at the "wall", you just check and clamp to a/60.
Title: Re: Axagon
Post by: matrefeytontias on December 23, 2014, 11:32:21 PM
Well yeah, that "angle" is called a polar coordinate. I'm applying this technique, because everybody would.
Title: Re: Axagon
Post by: novenary on December 29, 2014, 08:34:11 PM
Hmmm, looks pretty good so far. Keep it up. :)
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 30, 2014, 09:07:10 AM
You made me dig unto my 2yo prototype on Casio. I fixed things here and there but it's already working. I should poke Adbook (it was a duo work back then) for doing some work with me too. It's fun because it's quite close to what you did actually! ^^
Title: Re: Axagon
Post by: Dream of Omnimaga on December 30, 2014, 04:56:28 PM
Hm is he still around in the community? I think I recall seeing that name before. It would be nice to see new programs from him too indeed. Also Siarpan :P
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 30, 2014, 05:03:46 PM
Adbook is deep in his studies and Sirapran, I don't know 'bout him.
Title: Re: Axagon
Post by: novenary on December 30, 2014, 08:11:03 PM
Hmmm, you should poke Siapran into coming to CW. :P
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on December 30, 2014, 08:16:45 PM
He doesn't find the time to derp or program between the school and his preoccupations. We're derailling the topic quite heavily, should we stopping?
Title: Re: Axagon
Post by: novenary on December 30, 2014, 08:30:46 PM
Oh ok. And yes, back on topic. :)
Title: Re: Axagon
Post by: matrefeytontias on December 31, 2014, 02:35:20 AM
So yeah, back on topic. Collisions are implemented, next is scoring. Aaand I actually want to bring it a little further afterwards, so we'll see about that when the time comes :3 (I also have to do a titlescreen first).
Title: Re: Axagon
Post by: Dream of Omnimaga on December 31, 2014, 02:47:10 AM
Cool ro hear Matref. I can't wait to see the final product ^.^
Title: Re: Axagon
Post by: matrefeytontias on January 01, 2015, 01:42:38 PM
(https://img.ourl.ca/axagon3.gif)

Need I say more ? :P
Title: Re: Axagon
Post by: Keoni29 on January 01, 2015, 02:11:13 PM
That is pretty darn impressive!
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 01, 2015, 04:17:22 PM
Quote from: matrefeytontias on January 01, 2015, 01:42:38 PM
(https://img.ourl.ca/axagon3.gif)

Need I say more ? :P

Nice! U thought you were going for an UI like the original game though (and like what I did too) but I can't wait to see how you will progress!
Title: Re: Axagon
Post by: pimathbrainiac on January 01, 2015, 04:46:40 PM
Deleted accidental Double Post.

Nice job matref! Keep it up!
Title: Re: Axagon
Post by: Dream of Omnimaga on January 01, 2015, 11:03:34 PM
Looks very nice, so I take it that the colors will no longer be inverted? I like it with the score in particular by the way :)
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 02, 2015, 03:21:46 PM
DJ O I think he'll reverse them for another level or when beating 60 seconds in a run.
Title: Re: Axagon
Post by: Dream of Omnimaga on January 02, 2015, 05:13:30 PM
Aah that would be cool. I remember Cubefield did something similar after surviving for a certain amount of time.
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 03, 2015, 07:14:00 PM
Yeah it switched to green on black wireframe mode. But the original hexagon flash game doesn't do it IIRC. It comes from the Super Hexagon game. But well, I have more the C64 demake in mind (after 45 seconds it goes to full epilepsy mode)
Title: Re: Axagon
Post by: Dream of Omnimaga on January 05, 2015, 07:02:03 AM
Lol I hope that demake has warnings about it O.O (but again, most old NES games had much more worse flashy stuff and people who got them used without the instructions were probably not aware of it. >.<
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 06, 2015, 10:39:55 PM
Much worse flashy stuff? How can you do worse by flashing the whole screen?
Title: Re: Axagon
Post by: Dream of Omnimaga on January 07, 2015, 04:26:39 AM
Flashing exactly between color #FF0000 and #00FFFF at 60 FPS. For some reasons it seems more intense than #000000 <> #FFFFFF on some screens.
Title: Re: Axagon
Post by: novenary on January 21, 2015, 10:45:24 AM
Haha I hope monochrome calc games don't cause a seizure. And yeah DJ I think it's probably more intense to switch colors than just switching black/white.
Title: Re: Axagon
Post by: aetios on January 21, 2015, 01:43:32 PM
Wow this looks quite impressive, I feel bad for not checking this out earlier x.x Great job :D
Title: Re: Axagon
Post by: Dream of Omnimaga on January 21, 2015, 04:36:05 PM
Quote from: Streetwalrus on January 21, 2015, 10:45:24 AM
Haha I hope monochrome calc games don't cause a seizure. And yeah DJ I think it's probably more intense to switch colors than just switching black/white.
It is. I don't know why, considering the contrast is much lower. But I once watched that banned Pokémon episode and it was particularly intense compared to black/white flashes in NES/SNES games.

There is no danger with monochrome calculator games unless you use an emulator.
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 21, 2015, 04:39:29 PM
FLashing makes epileptic go <?> because it's flashing lights, a calculator doesn't emit light. (except color modelsexcept the nspire I think they're too slow to make a seizure flash).
Title: Re: Axagon
Post by: novenary on January 21, 2015, 04:42:33 PM
actually the CSE with buffer swapping might be fast enough.
Title: Re: Axagon
Post by: Dream of Omnimaga on January 21, 2015, 04:48:37 PM
Yeah I tried and it's even too fast. You have to slow it down so that it won't become a scanline fest. It's not as intense as the HP Prime, though, because the LCD is lower quality and the LCD has a blue-ish tint (so pink will look like purple, for example).

Anyway we should probably get back on topic lol. I wonder how hard a CSE hexagon port would be, though...
Title: Re: Axagon
Post by: matrefeytontias on January 24, 2015, 07:38:59 PM
Release time !

So instead of talking to describe it, I'll just post it and you try it :P but you still get a screenshot of the new title screen.

(https://img.ourl.ca/axagon4.gif)

Here you go for now, while it gets approved at ticalc : http://www.mirari.fr/PJ06
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 24, 2015, 07:41:52 PM
Hey! Congratulations on relasing! I hoped for moar graphical things but you kept to to the core! NIce work!
Title: Re: Axagon
Post by: matrefeytontias on January 24, 2015, 07:43:36 PM
Yeah, I wanted it to be enjoyable while remaining a small project that I don't want to spend more than a month on :P challenge successful, yeah ?
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 24, 2015, 07:45:42 PM
Absolutely! Have fun with the future feedback! :p
Title: Re: Axagon
Post by: matrefeytontias on January 24, 2015, 07:51:51 PM
Thanks, I hope to have much of it :P

Also, I took an actual screenshot of the gameplay for ticalc :

(https://img.ourl.ca/axagon5.gif)
Title: Re: Axagon
Post by: Snektron on January 24, 2015, 07:59:07 PM
Saweeet, im defenitely downloading this. If TI-Connect works >.>.
Anyway, seems like i have something to do in class when im bored :D
Title: Re: Axagon
Post by: matrefeytontias on January 24, 2015, 08:00:10 PM
Cool ^^

Also, anybody tell me if you reach 60 seconds, because then c gets real :P
Title: Re: Axagon
Post by: Duke "Tape" Eiyeron on January 24, 2015, 08:01:22 PM
Like what? Color reversing? Speeding up? Can't wait to see! :p
Title: Re: Axagon
Post by: matrefeytontias on January 24, 2015, 08:02:27 PM
Well, try and tell me :P reaching 60 seconds shouldn't be that easy either.
Title: Re: Axagon
Post by: Snektron on January 24, 2015, 08:26:22 PM
A royal 20 seconds  8)
EDIT: Scratch that, 32.80
EDIT2: 30.54! :o
EDIT3: 45.66 *.* im on a roll here
Title: Re: Axagon
Post by: Dream of Omnimaga on January 25, 2015, 05:03:56 PM
Quote from: matrefeytontias on January 24, 2015, 07:51:51 PM
Thanks, I hope to have much of it :P

Also, I took an actual screenshot of the gameplay for ticalc :

(https://img.ourl.ca/axagon5.gif)
that particular gameplay screenshots seems pretty intense O.O. anyway glad to see this released. :D
Title: Re: Axagon
Post by: Snektron on January 25, 2015, 06:18:35 PM
Quote from: matrefeytontias on January 24, 2015, 08:02:27 PM
Well, try and tell me :P reaching 60 seconds shouldn't be that easy either.

78.132, but it bugged out majorly. Is it normal to have 7 lanes, where one is 3 times as big as the others?
EDIT:
(https://lh5.googleusercontent.com/-43QWUZtPk3c/VMU0xAOYtpI/AAAAAAAABb0/HcKpXVg9N1E/w913-h685-no/2015-01-25.jpg)
sorry for the low quality, had to use my tablet cuz my phones camera wont work.
Also: Yes. My calculator is a pirate.

EDIT2: So yeah it's kind of a bug/cheat. Who wants to know how to activate it?  >:D
EDIT3: I've recorded the bug:
(https://lh5.googleusercontent.com/OkpkfNaqL5XkPtMHxHkG08YTy-R-tRy943oRIvI2jYA=w140-h93-p)
http://imgur.com/NUNutPt (http://imgur.com/NUNutPt) <- This one is like 3MB so mobile users be warned
Title: Re: Axagon
Post by: matrefeytontias on January 25, 2015, 07:24:37 PM
Oh c I forgot to remove the debug commands >_< if you have that build, please don't press 2nd or alpha in-game :P
Title: Re: Axagon
Post by: Snektron on January 25, 2015, 08:13:09 PM
Too late m80, my highscore is like 160
Title: Re: Axagon
Post by: 岩倉 澪 on January 29, 2015, 11:00:40 PM
awesome project, super hexagon is one of my favourite games :)