Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Android] Asteroid Encounter  (Read 16000 times)
0 Members and 1 Guest are viewing this topic.
Offline MrPork
« Posted 2015-06-23 02:05:33 »

* CAN A MOD DELETE THIS ONE PLEASE? I MADE ONE IN THE SHOWCASE SECTION*

 Hello! I'm here to show you guys my first android game! It's pretty much the standard space shooter, but I'll keep on adding more and more stuff to it with time (Which is why it's under WIP) . The controls are simple, it uses the accelerometer for movement and you tap/hold the screen to shoot. I realize the game is extremely easy right now, but I've only been making this for the past 2 nights so give me some slack.

I also haven't added it to google play because:

1. I am a poor teenage boy.
2. None of the sounds are of my creation (They're just there to keep me happy).

Download it here : http://www.mediafire.com/download/fxvq5zq5ktso1v9/Asteroid_Encounter.apk

Current Goals:

Accelerometer usage - ✓
Spaceship That Shoots - ✓
Destroyable Asteroids - ✓
Asteroids that rotate in different directions- ✓
Ability to die - ✓
Multiple Weapons - ✓
Particle System -  ✓
Aliens that Shoot back - X
Really fast asteroids- ✓
Asteroids that break into smaller asteroids - X
Heavily defended moon boss fights in between asteroid sessions - X
Power Ups - ✓
High Score System (With the ability to input name) - ✓      (Thanks to many people on these forums)
My own sounds and music - X/✓ (Only thing I need to make is music of my own or find copyright free music, anyone know of any?)








"f**k it, maybe it'll work." -Me
Offline CopyableCougar4
« Reply #1 - Posted 2015-06-23 02:08:18 »

use [img width=DESIRED WIDTH] instead of [img]

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline MrPork
« Reply #2 - Posted 2015-06-23 02:11:05 »

use [img width=DESIRED WIDTH] instead of [img]

Thank you! Cheesy

"f**k it, maybe it'll work." -Me
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline craftm

JGO Coder


Medals: 15
Projects: 1


_Keep Trying


« Reply #3 - Posted 2015-06-23 02:45:03 »

Working properly here, 480x800.
 Cheesy

_ Wink
Offline MrPork
« Reply #4 - Posted 2015-06-23 02:45:45 »

Working properly here, 480x800.
 Cheesy

Thank you for the feedback! Cheesy

"f**k it, maybe it'll work." -Me
Offline MrPork
« Reply #5 - Posted 2015-06-24 07:34:55 »

Welp, I've added lot's of visual enhancements and fixed many things. So it is now currently better than 90% of the xbox live arcade library.

"f**k it, maybe it'll work." -Me
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #6 - Posted 2015-06-24 13:55:18 »

Finally was able to get my hands on an Android device so I don't need to use the emulator anymore Grin.

I love everything about it apart from 1 tiny thing. I wish the ship was a little more responsive to the movement as I felt it moved a little slow but this isn't really an issue. The particle effects work well as well as the sounds. I think this could be a great game with some more weapons and variety Smiley. 1 possible bug that I found was that an asteroid was overlapping another but to be honest it's not a huge issue.

I really like your parallax scrolling and was wondering how you did it? I believe you just move the layers at different speeds/directions compared to everything else, correct?

EDIT: Oh and what viewport are you using? It looks really good, much better than the fitviewport I use

Hey, you! Back to work
Offline MrPork
« Reply #7 - Posted 2015-06-24 17:15:07 »

Thank you for the feedback!

1. I actually want the asteroids to overlap because they're speed is randomized and adds a tiny sense of depth
2. I'm using a stretch viewport with a resolution of 640x480 so that the game should look nice on most devices.
3. I too found it to be unresponsive, mostly do to the fact that the ships start moving after a medium amount of tilt of the device. I already fixed it, but haven't uploaded it. Also, the ship moves faster the more you tilt the device.
4. For the star field, I just have a Star class that keeps track of its own position and speed. I then have a Star Field class that has an array list and adds 300 stars on startup, then just renders and updated the stars. Be sure to create the star texture in the StarField class and just pass it on to the stars in their constructor or else you might get performance issues pretty easily. And yes, the stars just have different speeds, just put that in their constructor as well. I also suggest you make a texture for small stars and slightly bigger stars to add an even more sense of depth.

"f**k it, maybe it'll work." -Me
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #8 - Posted 2015-06-24 19:25:07 »

Thank you for the feedback!

2. I'm using a stretch viewport with a resolution of 640x480 so that the game should look nice on most devices.
4. For the star field, I just have a Star class that keeps track of its own position and speed. I then have a Star Field class that has an array list and adds 300 stars on startup, then just renders and updated the stars. Be sure to create the star texture in the StarField class and just pass it on to the stars in their constructor or else you might get performance issues pretty easily. And yes, the stars just have different speeds, just put that in their constructor as well. I also suggest you make a texture for small stars and slightly bigger stars to add an even more sense of depth.

Ah, I'll have to look at using the stretch viewport instead of the fit viewport and see what results I get for my games Smiley I usually create them at 800x600

That seems like performance would be affected due to removing/adding all stars all the time? Have you tried using a texture that already has some stars and then implementing a layer of random stars? So you might only need to handle 50-80 stars instead of the 300. Of course, you could also use standard textures and use Texture.wrap but this wouldn't be random which you want. It's just a concern I have as Android devices aren't the most powerful but if it's working well, keep doing what you're doing! Pointing


Hey, you! Back to work
Offline Opiop
« Reply #9 - Posted 2015-06-24 19:34:02 »

So long as you are maintaining the same aspect ratio (most Android phones will have the same aspect ratio), then you don't need to use a ViewPort. Just create an OrthographicCamera:
1  
2  
camera = new OrthographicCamera();
camera.setToOrtho(false, window_size.x, window_size.y);


And then in the resize method:
1  
2  
3  
4  
@Override
public void resize(int width, int height) {
   window_size = new Vector2(width, height);
}


Sure, it won't scale nicely if you dramatically change the aspect ratio, but that most likely will never happen. Works great, and you don't have to deal with those strange viewport classes.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #10 - Posted 2015-06-24 20:47:24 »

So long as you are maintaining the same aspect ratio (most Android phones will have the same aspect ratio), then you don't need to use a ViewPort. Just create an OrthographicCamera:
1  
2  
3  
4  
5  
6  
7  
8  
camera = new OrthographicCamera();
camera.setToOrtho(false, window_size.x, window_size.y);

And then in the resize method:
@Override
public void resize(int width, int height) {
   window_size = new Vector2(width, height);
}


Just a quick question. Doesn't the camera have a stretch viewport by default so you wouldn't even have to give it the window_size? Or is it so it knows to try and stretch it as that preferred ratio. So I mean, it will use a "virtual width/height" which is the resolution we develop it for and then it is stretched from that, rather than Gdx.graphics.getWidth()/getHeight() with changes depending on the size of the phone.

Example code:
1  
2  
3  
4  
5  
6  
7  
camera = new OrthographicCamera();
camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

public void resize(int width, int height) {
cam.viewportWidth = width;
cam.viewportHeight = height;
}


Is there any difference here?

Hey, you! Back to work
Offline Opiop
« Reply #11 - Posted 2015-06-24 21:06:49 »

If you don't give the camera then I'm fairly certain the width and height will default to NDC (1 to -1). The width and height supplied in the setToOrtho method is the virtual width & height, so I don't entirely understand your question.

As for your code example, your virtual width and height will change depending on the screen size, is that what you want? That means that the game would look far different on a tablet than it would on a phone. If you give it a constant width and height, say 1280x720, the game will always render at 1280x720px. The only issue is if the screen ratio is not the same as your specified ratio (1280x720 = 16:9). However like I said earlier, you will most likely not run in to that issue with phones as most of them have the same aspect ratio.
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #12 - Posted 2015-06-24 21:23:26 »

If you don't give the camera then I'm fairly certain the width and height will default to NDC (1 to -1). The width and height supplied in the setToOrtho method is the virtual width & height, so I don't entirely understand your question.

As for your code example, your virtual width and height will change depending on the screen size, is that what you want? That means that the game would look far different on a tablet than it would on a phone. If you give it a constant width and height, say 1280x720, the game will always render at 1280x720px. The only issue is if the screen ratio is not the same as your specified ratio (1280x720 = 16:9). However like I said earlier, you will most likely not run in to that issue with phones as most of them have the same aspect ratio.

I think I understand, the part that is confusing me is when you set the window_size after the resize. Will this not resize the game anyway depending on the different phone/tablet device? I always develop my games for 1 screen size (800x600) so I ideally want the same virtual width/height on all devices but I don't see the difference between the 2 code samples as they both end up changing the camera at the resize Huh.

Hey, you! Back to work
Offline MrPork
« Reply #13 - Posted 2015-06-24 21:47:09 »

I don't remove the stars, I just place them back at the top.

"f**k it, maybe it'll work." -Me
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #14 - Posted 2015-06-24 21:48:06 »

I don't remove the stars, I just place them back at the top.

Ahh I see Smiley that seems perfectly fine then. I keep loading the game up on my Android xD

Hey, you! Back to work
Offline MrPork
« Reply #15 - Posted 2015-06-24 22:15:59 »

Is it actually fun, or is it pretty much just like meh? I've still got a lot to work on thougy, so maybe currently that's not an appropriate question

"f**k it, maybe it'll work." -Me
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #16 - Posted 2015-06-24 23:16:02 »

Is it actually fun, or is it pretty much just like meh? I've still got a lot to work on thougy, so maybe currently that's not an appropriate question

I enjoy it though I wish there was more Smiley with some variety I can't see why it wouldn't be really fun. It's a fun little arcade game

Hey, you! Back to work
Offline MrPork
« Reply #17 - Posted 2015-06-25 01:03:35 »

Tomorrow I will upload the new version. It will contain 3 power ups, a Blue one that freezes time ( Feels pretty amazing when you're at one life and that suddenly appears as soon as a one of the flaming asteroids is about to hit you), a red one that gives you extremely powerful missiles that does AOE damage and allows you to destroy flaming asteroids, and a green one that makes you shoot 3 bullets 2 diagonally and 1 straight. After that, going to add alien ships that shoot back, and then after that going to put everything together to make boss fights where you have to destroy a moon or a planet. After that graphical cleanup, sound cleanup, performance cleanup, and going to gather money to become a google play developer.

"f**k it, maybe it'll work." -Me
Offline MrPork
« Reply #18 - Posted 2015-06-25 16:47:38 »

I updated the download Link!

The game now has:

  • 3 Power Ups (More to come)
  • More sounds

"f**k it, maybe it'll work." -Me
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #19 - Posted 2015-06-25 16:58:06 »

I updated the download Link!

The game now has:

  • 3 Power Ups (More to come)
  • More sounds

Much better MrPork Smiley I destroyed 240 asteroids Grin

Hey, you! Back to work
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (585 views)
2019-09-04 15:33:17

hadezbladez (5521 views)
2018-11-16 13:46:03

hadezbladez (2405 views)
2018-11-16 13:41:33

hadezbladez (5783 views)
2018-11-16 13:35:35

hadezbladez (1226 views)
2018-11-16 13:32:03

EgonOlsen (4666 views)
2018-06-10 19:43:48

EgonOlsen (5685 views)
2018-06-10 19:43:44

EgonOlsen (3199 views)
2018-06-10 19:43:20

DesertCoockie (4099 views)
2018-05-13 18:23:11

nelsongames (5116 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!