Kamis, 16 April 2020

Asteroids - Java-Gaming.org Asteroids Java Code

Asteroids - Java-Gaming.org

Offline

Hey,

I'm new here and want to share my new game.

Usually I write games just for fun, and never really publish them, because I find them not polished enough. Spent some more time with this one now, and I hope you like it. Wink

First of all I want to give some credit to

I'd appreciate your feedback. If you find any bugs please let me know. Wink

Hope you enjoy Wink

Offline

Oh. What OS do you use?

/edit: and have you downloaded the whole zip? The save folder has to be at the same destination as the jar.

Games published by our own members! Check 'em out!

Offline

Can you please start it with the cmd?

like

1  

2  

cd desktop/asteroids

java -jar asteroids.jar

If there's an error it will show up in the cmd.

Offline

I also get a blank screen when I start it up. I'm using Windows 8 myself.

Attempting to start it through the CMD interface (java -jar Asteroids.jar) results in no standard error. However, if I close the UI screen the CMD does not acknowledge an exit (Not sure if that's important in this case or not.)


Offline

I don't get it. I use Windows 8 myself and everything works...

Just to be sure, you both downloaded the zip, not just the jar?

That's the only idea I have...

Offline

I will upload it somewhere else tomorrow.

Hope I'll be able to fix that. I just sent it a friend and it works for him.

Could someone else try it please?

Games published by our own members! Check 'em out!

Offline

Nice game, works fine for me, Win7 64

Areas for improvement (just some quick critique):

  • Sounds / Music (sounds, like menu blips, blaster fire, and explosions are more important than music for a game like this IMHO, check out if you're interested.
  • I think you should be able to hold down the arrow keys to auto-scroll the menu
  • Maybe I'm just forgetting how the original Asteroid worked, but this would honestly be much more fun if the blaster was manual instead of auto

Otherwise, I really like the style and aesthetics you got going here. SO many amateurish games looking far less professional than they might only for lack of a good font!  Wink (and, you know... cohesive looks)

Offline
1  

2  

3  

4  

5  

6  

7  

8  

9  

10  

Exception in thread "Asteroids" java.lang.IllegalStateException: Buffers have not been created

        at sun.awt.X11.XComponentPeer.getBackBuffer(XComponentPeer.java:1223)

        at java.awt.Component$FlipBufferStrategy.getBackBuffer(Component.java:4041)

        at java.awt.Component$FlipBufferStrategy.updateInternalBuffers(Component.java:4026)

        at java.awt.Component$FlipBufferStrategy.revalidate(Component.java:4141)

        at java.awt.Component$FlipBufferStrategy.revalidate(Component.java:4123)

        at java.awt.Component$FlipBufferStrategy.getDrawGraphics(Component.java:4115)

        at main.Game.draw(Game.java:102)

        at main.Game.run(Game.java:82)

        at java.lang.Thread.run(Thread.java:744)

Arch Linux 64-bit.

Edit: Tried again, and this time no error, but black screen.

Also, when I exit the window it doesn't actually terminate. You may want to look into that or else players will have a whole lot of unwanted processes.


Offline

Im using windows 8 and it works perfectly.

This game is very polished and looks professional! Great work. Its fun, but it has the potential to be so much more fun if you just fix a few things.

1. The game gets too hard too fast. I have a ton of fun testing my new upgrades and blowing up asteroids but as soon as the spaceships that shoot directly at me show up, im getting spawnkilled over and over again. You dont have to take them out, just nerf them. Maybe make their range really short?

2. A couple of the upgrades are really expensive, like the multiple shot upgrade. I dont know. Maybe it wouldnt be too bad if problem #1 was fixed.

3. When I go to set my name, If you move the cursor right and go up and down to switch letters, it like, moves them left? And gets messed up.

Also whats up with the file called "Nothing in here!.txt" haha? I cheated by editing you text save files, and then deleted that other empty file and things got all messed up. (My saves were no longer being loaded properly, I assume).

Anyway, this is really a sweet game, good work.

Offline

Slow! Maybe 5~8 fps in Xubuntu 13.10.

Why I can't change resolution? At least make the game full screen to improve performance.

Offline

My computer is not new but this is not my computer issue. Even a old computer with 1GB ram and Pentium 4 (or even older) must run this kind of 2d games.

The problem here, I think, is because the window size. We can't change resolution and 1920x1080 (my screen resolution) is too much for Java games.

And on Linux full screen make a huge difference. For example if I play teeworlds minimized I have ~20fps, if I play full screen maybe +~90 fps. The same with other games.

Please make this game with real full screen or with an option to change resolution size.

My specs (though not the problem):

-3GB ram

-core 2 duo @ 2.53GHz

-Radeon HD 5670

Offline

It's definitely not the problem, as I have a Radeon HD 4670, it's 6 years old (a gen behind yours), Fraps reports solid 60 fps (at 1080p). CPU is a Phenom II, but this game appears to be (not going to break out the decomplier, have things to do) single-threaded, so the quad-vs-duo thing doesn't matter a whole lot.

I'm not disagreeing with you, aside from the 'too much for Java games,' as I'm honestly puzzled as to why you're getting such poor performance.

That said, full-screen should be an option here, if not only to figure this out.

Offline

Thanks for all your feedback, I'm glad it works at least for some of you.

I'm sorry some of you have all these problems, I'll try to figure out how to fix them.

You only need 4 textfiles: highscore, and savegame1-3. If they're empty or something's wrong with them it will automatically clear them and recreate them.

At least that's what it should do.

@saucymeatman and BurntPizza:

I find balancing is one of the hardest parts in a game, but I will try to improve this. Thanks for your tipps.

The game is fixed at a resolution of 1920x1080, and I just scale it up or down depending on the actual screen resolution.

@ricardo: What do you mean with real fullscreen? What is not real about it?

/edit: I might have found a solution for the IllegalStateException. I never had the error, so I don't know if it's fixxed now, but I hope so.

Downloadlink above is updated.

/edit2: Maybe I should not forget putting the save folder in it. Sorry :/

Offline

@bene What do you mean with real fullscreen? What is not real about it?

A window with 1920x1080 is not full screen. Yes the window fits the whole screen, but is different from *real* full screen.

Also, to improve performance, you can create your game in 800x600 and scale it up, instead of 1920x1820 and scale it down. Or one option to change resolution in-game.

This is just my opinion. Personally, I like to make my games in 600x480 or 800x600 and scale them up. And enable full screen (I don't know how to do this in libgdx, but in java2D you only need ).

Offline

I did it this way, but there were so many problems with it. I removed the fullscreen-mode now, hoping there will be less errors/black/gray/white screens.

You're right, I could've just made it in 800x600, I just didn't think about performance there.

As I said in the first post, this is my first game I'm really publishing. Now I'm aware that "runs on my PC" doesn't mean "runs on everyones PC".

Next time I'll test it on different machines, sorry for all the problems.

Here's the windowed version, I'll replace the link in the startpost as well.

I also added some sounds, but some will follow. Thank's to BurntPizza, this site is great.

Offline

Everything works fine now.

Very hard and addictive Cheesy

I found one error with one quick fix: If we lose all lives we spawn again for a short moment before main menu. Make our spaceship invisible.

EDIT: No sound here.

Items should be more expensive. With 40 min of game play I already have everything maxed out. Add more items like shields, more bullets, extra life, more powers like wave of bullets etc.

Really nice game, if you polish it more and add more stuff you can even sell this.

Offline

I have to say, your UI looks really nice!

I am following the same tutorial you used. Does he cover how to do such nice fonts and UI in later parts, or how did you accomplish that?

Offline

Thanks for your feedback.

@ricardo: I know, as I said I find balancing pretty hard. I think upgrades like firerate or number of bullets (which is kind of like doubling the firerate at the first level) are a bit OP and I'll make them more expensive.

Thanks for your tipps Wink

@digdugdiggy: For the font I just went to dafont.com. I think in the tutorial is covered how you do things like a menu. If you have any specific questions about it PM me and I can send you some sourcecode if you want.

0 Comments

Posting Komentar