Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / T2 Android - Asteroids Clone

Author
Message
PaulTR
6
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 18th Nov 2012 06:48 Edited at: 18th Nov 2012 07:20
Hello!

Thanks to a great deal of help from AL, I've managed to get my game together and running on Android instead of just Windows!

A little background:

I'm currently a senior at California State University, Fresno, and I am taking a beginning game development course that just started being offered this semester. For our course project, we had to come up with a game and build it using C++ and AppGameKit, so I decided to go with an Asteroids clone. Using AppGameKit was a lot more simple than I expected going into the course, and I managed to write a Windows version of Asteroids in about 4 days (not solid days, mind you, but 4 days with other class work and jobs, so it's even better than that!). After some tweaks, such as switching from virtual resolution to using aspect ratios, and bug hunting, I'm about done and ready for release once I have some art (*ahem* non-stolen from Google images art).

My experiences with AGK:
Overall, great. The functions for sprites made life very easy, the documentation was clear for the most part since the function names are fairly self explanatory, the physics functions were pretty great and everything was very straight forward for working with. The sprite offset functions are amazingly useful, and the collision detection/sprite shapes work great. I actually don't think I ran into any issues where AppGameKit caused my app to crash, either.

While I'd hate to be negative, I know mentioning the downsides helps the developers pinpoint what could make things better, so here goes: changing a sprite position with agk::SetSpritePosition() turns off the sprite's physics velocity, which may or may not be intentional. This was easily fixed in my program since I made extensive use of classes, so I just saved velocityX and velocityY for everything, but worth mentioning. I believe agk::SetSpriteAngle() and agk::SetSpriteImage() also had the same affect.

I would also have loved a feature on the virtual joystick that limits which directions it's able to move. There may be one, but I didn't see it, so figured I'd mention it. With my game I only used the X-axis and ignored the Y-axis, but it'd be nice to restrict users from even being able to use the Y-axis if it's not required for the program.

The sound/music functions were great, however I would also have loved a playlist function where you can set music to start after the previous audio file has finished, and then loop back to the first once the list is exhausted. I also ran into an issue where agk:layMusic(musicId, 1) wouldn't loop, so I'm playing around with that right now to see if I can't figure out how to make that work.

Overall I would say my biggest gripe is the square button issue. If there's a way to use sprites instead of buttons, that'd be awesome, but right now with rectangular images set to the buttons I still have weird bounding issues that I'm just going to ignore when I release the app for now >.>

Anywho, great engine! Here's a couple screen shots of what I've put together for the class taken directly from a Nexus 7, and it runs just as well on an HTC Incredible 2



MarcoBruti
7
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 18th Nov 2012 17:15
Hi dude, congratulations!
I have wished to have (about 20 years ago) some course in game programming when attending Electronic and Computer Science Engineering in Rome, so I had to do by myself first with a TI99/4A and then with PCs.
This computer, although being a disaster from the architectural point of view, had a good success in Italy and featured TI Extended Basic, an "AGK ancestor" wich let you create, manage, move and check collision of sprites.
I have programmed a lot of games with TI, including a Frogger clone.
I tried to program some games with Java and Visual Basic, but effort is much more than with AGK.
I thanks AppGameKit and TGC because, notwithstanding some bugs or defects, it make me return to my ancient game programming age...
A questions: have you got any crash when using MP3 music files? The music loop that does not work is a well know issue, but there is also an issue with Android and MP3 files.
PaulTR
6
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 18th Nov 2012 18:12 Edited at: 18th Nov 2012 18:12
Actually yeah, I did have some freezing with the mp3 last night when I was working with it. Whenever I would try to stop, delete, then load and play the same file it would crash. There were a few other combinations that did it as well. I ended up just using PlayMusic(musicId, 0) in begin() and having a statement at the start of my loop like this

if(agk::GetMusicPlaying == 0)
{
PlayMusic(musicId, 0);
}
PaulTR
6
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 23rd Nov 2012 08:34
Did some modifications, got in all open source/artsy friend made art, and got it on the market! First Android app out. Stoked lol


https://play.google.com/store/apps/details?id=com.ptrprograms.asteroidbelt
RickV
TGC Development Director
18
Years of Service
User Offline
Joined: 27th Apr 2000
Location: United Kingdom
Posted: 23rd Nov 2012 12:32
Well done! Just paid for a copy. Will play it once the Nexus 7 is back up to full charge.

Rick

Financial Director
TGC Team
erebusman
7
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 23rd Nov 2012 18:51
Nicely done; and congrats on finishing your title!

Question: When you send your app to the background - does the music keep playing? I'm having that problem on my android app I'm working on just curious if others are having the same problem?

PaulTR
6
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 23rd Nov 2012 19:39
It does if I just hit the power button (the onPause android portion of the life cycle), but not if I hit the home or back button. Actually been playing around with that so I can update it soon :p I'll get back to you though if I figure it out.
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Nov 2012 17:44
PaulTR, I'm so glad I was able to help.

And it looks pretty cool!

I just got back from being away all week and will be busily catching up (site security especially). I'll give the game a go when I'm done.

Good luck with it and Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester
erebusman
7
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 26th Nov 2012 03:55
@PaulTR : thanks anything you figure out would be very useful.

I have a release I can not ship through WildTangent because the music keeps playing. Naturally I'm working on it too but if anyone else comes up with ideas that help isolate what the cause is I'd definitely take the help!

PaulTR
6
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 26th Nov 2012 05:09
Yeah I'm not sure, I don't have anything different that would stop the music, but it does it on its own. Still keeps playing if I just hit the power button. Maybe they'll update AppGameKit with some kind of GetPaused() function to go with GetResumed()
erebusman
7
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 26th Nov 2012 23:27
Thanks for the update Paul , that's my thoughts also we need a get paused function!

RichardH
6
Years of Service
User Offline
Joined: 29th Nov 2012
Location: California
Posted: 18th Jan 2013 18:02
@erebusman: Hey I had the same problem with the music continuously playing in my app and a quick Google search led me to this post. I figured out that I had my music file loaded in using LoadSound() when I should have been using LoadMusic(). Apparently 'Sounds' keep playing in the background until finished but 'Music' pauses when the home button is pressed, and both keep playing when the power button is pressed(At least on my Droid Bionic). I assume you already solved this problem but I just figured it out so I replied for anyone else having issues. BTW good work on your game Paul!

Login to post a reply

Server time is: 2019-03-22 07:22:02
Your offset time is: 2019-03-22 07:22:02