CodeWalrus

CodeWalrus Website => Game, Software and Music Downloads => Games => Topic started by: Dream of Omnimaga on June 09, 2016, 06:05:07 AM

Title: [TI-84+CE] GalagACE, a shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 09, 2016, 06:05:07 AM
I know that @JamesV and Patrick Davidson already made much better TI-84 Plus CE shoot-em-ups in ASM, but for a long while I wanted to jump in the 2D space shooter bandwagon and decided to make one written in hybrid TI-BASIC: GalagACE:

https://www.youtube.com/watch?v=0Jbc07X_3wE
(https://img.ourl.ca/galagacestill2.gif) (https://img.ourl.ca/galagacestill1.gif)

Arrows: Move left and right
2nd: Shoot
CLEAR: Quit (never quit with the ON button!)


[spoiler="original post"]
https://img.ourl.ca/galagace1.gif
Basically, this game is a remake of the crappy Space Invaders clone I made in early 2002, which could be found in Omnimaga Pack 25 games in 1. I decided to rename it to GalagACE, which is a play with the words Galaga, Ace and CE. I am now using sprites rather than the home screen. However, the code is ancient so I'm gonna rewrite most of it to attempt increasing the game speed.[/spoiler]
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Snektron on June 09, 2016, 08:58:52 AM
Looks pretty good :) It would be cool if there was a space like background, with a few stars and such.
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 09, 2016, 05:26:36 PM
Thanks Cumred. The star background was actually an idea I had, but I was unsure how I would do it at the time, since Sprites don't support clipping. However I was considering just making multiple frames with the star background offset to simulate scrolling. Star pixels would be 7x7, though.

Another thing to note is that the Sprites library lacks transparency support in order to keep speed as high as possible (probably why it lacks clipping too?). Right now I erase the entire screen with two black sprites zoomed out so that I don't have to use a separate rectangle call. So I could easily replace those plain black sprites with actual stars.


Which color should the star pixels be @Cumred_Snektron to avoid making it hard to distinguish foreground elements?
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: unregistered on June 09, 2016, 07:38:45 PM
nice, DJ Omnimaga :)

One detail : SETTINGS also clear screen in black (faster way than CLSCREEN) ;)

I optimised a bit GALACACE (just for help ;) ), You can take a look at it (renamed GALAGAC to avoid confusion)
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 09, 2016, 08:14:16 PM
The issue with SETTINGS though is that in CEmu it doesn't erase the screen with just black, but also some green static.

Also I'll take a look at your code :) . Most of the game code was written in March or April 2002 and when I looked at my code yesterday I was shocked at how long the main loop was compared to my more recent games o.o
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: TheMachine02 on June 09, 2016, 08:26:20 PM
Nice. It look really good  :D It is strange that cemu put green static though - the emulation core is almost perfect from what I could see. How does SETTINGS clear the screen @grosged ?
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: unregistered on June 09, 2016, 08:33:19 PM
I wanted SETTINGS to make a black screen (because going into 8bpp mode) and as fast as possible :

ld hl,$e40000
ld de,$d40000
ld bc,153600/2

$e40000 is a memory-area where we can't write, only read...And it only read zeros (with less Wait-States than usual)
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 09, 2016, 08:34:00 PM
Yeah I don't get any static on the real calculator. It only happens on CEmu.
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Snektron on June 09, 2016, 11:25:47 PM
Quote from: DJ Omnimaga on June 09, 2016, 05:26:36 PM
Which color should the star pixels be @Cumred_Snektron to avoid making it hard to distinguish foreground elements?

The enemies are blue, so i think light yellow / orange on a dark blue background would fit nicely
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Unicorn on June 09, 2016, 11:44:59 PM
Great job on this, it's much better than caterite :P
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 10, 2016, 12:14:17 AM
Quote from: Cumred_Snektron on June 09, 2016, 11:25:47 PM
Quote from: DJ Omnimaga on June 09, 2016, 05:26:36 PM
Which color should the star pixels be @Cumred_Snektron to avoid making it hard to distinguish foreground elements?

The enemies are blue, so i think light yellow / orange on a dark blue background would fit nicely

Hm what about teal or magenta stars?
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 10, 2016, 08:50:21 AM
By the way I tried your program @grosged and this is what I meant about the static:

(https://img.ourl.ca/galagac.png)

This only happens in CEmu, not on the real calculator. This is why I always add a 0:Asm(prgmCLSCREEN after using Asm(prgmSETTINGS.

Also I didn't know we could zoom sprites bigger than 7x? O.O (I noticed the G0 thing) (EDIT: Nevermind, it seems like a typo or something because it seems to act like 7)


EDIT: Also here are some updates:

-Boss fights (basically they're just a set of enemy but with an extra sprite that is larger displayed under them so that it looks like you're putting holes in the boss ship). Once all targets on the ship are destroyed, the boss disappears and the next enemy wave arrives.

-You can now shoot multiple bullets at once! (4 maximum). However, collision detection have slowed down things quite a bit, so I'll need to find  a better way to check if each bullet has hit the enemy one by one. Shooting the bullets themselves isn't slowing things down because it doesn't require much code, but collision check is a different story >.<

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

On the other hand, the speed is now on-par with the original game, so that's a start. I need to make boss and late enemy bullets move faster, though.


Also @Cumred_Snektron the star background idea won't work, because I don't have enough sprite memory to fit all frames in D:
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: aetios on June 10, 2016, 08:55:38 AM
Looks really really nice. I'm looking forward to see how this turns out.
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: tr1p1ea on June 10, 2016, 09:51:10 AM
Love the graphics, looks awesome :).
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: TheMachine02 on June 10, 2016, 10:06:42 AM
Yeah, I agree ! It seems pretty fast. That boss look cool too :D
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 10, 2016, 03:14:24 PM
Thanks, glad you like the speed. Speed is actually a bit slower on-calc when you have several sub-programs so ideally you'll need to delete most of your calc content before playing if you want max speed but it isn't that bad. I would like to increase the speed further, though, such as only checking for bullet collision when they get around a certain height. A For( loop is out of the question because they're much slower, but here's my code so far for bullet collision >.<

L₁(1)-B→F
J→D
If F>0 and F<5 and D>0 and D<4
Then
If 0<[A](D,F
Then
[A](D,F)-1→[A](D,F
U+100→U
{10,20L₁(1)-20,30J-30
Asm(prgmSPRITE
0→L₂(1
End
End
L₁(2)-B→F
K→D
If F>0 and F<5 and D>0 and D<4
Then
If 0<[A](D,F
Then
[A](D,F)-1→[A](D,F
U+100→U
{10,20L₁(2)-20,30K-30
Asm(prgmSPRITE
0→L₂(2
End
End
L₁(3)-B→F
L→D
If F>0 and F<5 and D>0 and D<4
Then
If 0<[A](D,F
Then
[A](D,F)-1→[A](D,F
U+100→U
{10,20L₁(3)-20,30L-30
Asm(prgmSPRITE
0→L₂(3
End
End
L₁(4)-B→F
O→D
If F>0 and F<5 and D>0 and D<4
Then
If 0<[A](D,F
Then
[A](D,F)-1→[A](D,F
U+100→U
{10,20L₁(4)-20,30O-30
Asm(prgmSPRITE
0→L₂(4
End
End
End
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 12, 2016, 06:58:59 AM
Good news: The engine now supports multiple enemy formations and can now have more than 1 kind of ship per formation!

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

All bosses are identical, though, except that they have more targets to destroy as you progress through the game and the final boss has blue-gray targets that takes 9 hits to destroy. :)


Right now I am reducing the amount of bullets you can shoot at once to 3 instead of 4, because when I add the HUD your ship will be moved up by 30 pixels anyway so it will take less time for each bullet to travel.
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Jim Bauwens on June 12, 2016, 06:17:19 PM
Looking nice :)
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 12, 2016, 07:45:56 PM
Thanks. :) By the way I am thinking about adding power ups like in Galaxian and Star Fox. Lasers would shoot an entire vertical line instantly and bombs would damage a large radius area by 1 or 2 pts, but you would need to be accurate when detonating them. As for the laser I was considering allowing shooting with the Up arrow or Del key, which would let me charge the normal weapon, but at the cost of not being able to move during charging. What do you think?
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 14, 2016, 07:56:19 AM
Good news: The game is almost complete at this point. I might need help optimizing the bullet collision code since I never made a multi-bullet shooting routine before but so far the game runs at decent speed for hybrid BASIC. I don't have time to make a readme right now, but you can download the game in the first post

https://codewalr.us/index.php?topic=1390.0


Here's a Youtube video of the game in action now:
https://www.youtube.com/watch?v=0Jbc07X_3wE

And here are screenshots for those who can't see the video yet:
(https://img.ourl.ca/galagacestill2.gif) (https://img.ourl.ca/galagacestill1.gif)

Controls:
2nd: Shoot
Arrows: Move left and right
CLEAR: Quit

There are 18 enemy waves (including 6 bosses) and you have 5 lives. You gain between 100 and 900 points depending of the enemy ship/target and highscores are now supported. If you beat the entire game, the HUD changes color and you restart with only 1 life (although you keep your score, so you can rack it up as high as you can).
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Snektron on June 14, 2016, 02:27:53 PM
Looks pretty good. Do the enemies speed up later in the game?
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 14, 2016, 02:54:13 PM
Thanks, and nope that's the max speed the game can run at. They have more health and bosses shoot differently, though
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on June 20, 2016, 12:09:50 AM
Thanks @critor for the ticalc.org front page news about GalagACE :3=

http://www.ticalc.org/archives/news/articles/14/148/148915.html
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: JamesV on July 11, 2016, 06:41:45 AM
This is great, DJ_O; nice work!
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on July 11, 2016, 06:43:29 AM
Thanks, and nice to see you again JamesV. Are you still doing music or working on calculator projects, by the way? :)
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: JamesV on July 11, 2016, 06:51:28 AM
Quote from: DJ Omnimaga on July 11, 2016, 06:43:29 AM
Thanks, and nice to see you again JamesV. Are you still doing music or working on calculator projects, by the way? :)
It's good to check in to the scene again, I haven't been keeping up on things until the last few days. Since finishing up with my band back in March, I haven't done much with music, apart from filling in for my Dad's band for a local show. But I'm involved in a new project with some friends now that will be a nice little hobby band :)

I just picked up my CE the other day for the first time in a few months, so we'll see if that leads to anything in the near future!
Title: Re: GalagACE, a TI-84 Plus CE shoot-em-up written in hybrid BASIC
Post by: Dream of Omnimaga on July 11, 2016, 07:12:42 AM
Aah I see. Yeah I was a bit worried since I thought leaving Belle Haven would make you more into calculators, then you suddenly disappeared so I thought you called it quit again like around 2006 or so. But again I also sometimes stop coding for long stretches of time. I can't wait to see what the new band is. :)