Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 24
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-08 10:50:29
Hmmm, does not seem to with LibGDX Array.
That's because LibGDX's developers took care if this issue, but with Java's built-in collections you can not modify a collection while you're iterating over it using a for-each loop.

To the OP: Use ListIterators. They can both remove and add elements to the collection during iteration. Smiley

So why is the OP using an ArrayList and not an Array<?>....

2  Game Development / Newbie & Debugging Questions / Re: Should I move to LibGDX? on: 2014-07-08 00:20:09
You can set the camera to be y-down like you're used to by calling

Or just simply deal with it. Any snippets you find using LibGDX will be using y-up, so you might just end up confusing yourself.

Especially when it comes to fonts.
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-07 19:22:03
@Gibbo If I'm not mistaken, that'll throw a ConcurrentModificationException

Hmmm, does not seem to with LibGDX Array.

For instance in my breakout game I am iterating through the Array of Blocks, to check if Ball overlaps a Block, if so remove from array. It gets removed during iteration.
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGdx, update list while iterating through it on: 2014-07-07 16:04:09

    for(Thing thing: aListOfThings){
            aListOfThings.remove(thing, true);

Unless I am missing something here?
5  Game Development / Newbie & Debugging Questions / Re: Should JGO have a JGO Store? on: 2014-07-07 15:54:10
This would also require maintenance + extra security. Riven has enough things to deal with.
6  Game Development / Newbie & Debugging Questions / Minimal Translation Distance too short? on: 2014-07-07 15:17:32
I am having a little bit of trouble using an MTD formula for basic AABB collision detection.

The problem being is that the moving object collides with a static object, it should respond by "bouncing off" in the correct direction, so depending on the value of X or Y, I reverse the respected velocity of the moving object.

So I have a Ball and a Block, ball hits block > block gets deleted and ball bounces fine

However if ball hits a block and block say has, 3 health and requires 3 hits...the ball will collide with it constantly until it no longer exists. If that makes sense?

Basically this here:

Vector2 mtd;
if (ball.getBounds().overlaps(block.getBounds())) {
               mtd = ball.getBounds().getMinimumTranslation(
               if (mtd.x != 0) {
                  ball.velocity.x = -(ball.velocity.x * ball
               } else if (mtd.y != 0) {
                  ball.velocity.y = -(ball.velocity.y * ball

               notify(block, Event.BLOCK_COLLISION);

The value of MTD is so small that it can not resolve the collision properly, so adding it to the current ball position does not move it out of the bounds of said block.

What can I do to stop this?

Here is the MTD method:

public Vector2 getMinimumTranslation(BoundingBox other) {

      /* The collision vector */
      Vector2 mtd = new Vector2();

      /* The left side of the AABB */
      float right = (other.getX() + other.getWidth()) - this.getX();
      /* The right side of the AABB */
      float left = other.getX() - (this.getX() + this.getWidth());
      /* The top side of the AABB */
      float top = (other.getY() + other.getHeight()) - this.getY();
      /* The bottom side of the AABB */
      float bottom = other.getY() - (this.getY() + this.getHeight());

      /* If right is less than left, we collided left */
      if (Math.abs(left) < Math.abs(right)) {
         mtd.x = left;
      } else {
         /* Else we collided right */
         mtd.x = right;

      /* If top is less than bottom, we collided top */
      if (Math.abs(top) < Math.abs(bottom)) {
         mtd.y = top;
      } else {
         /* Else we collided bottom */
         mtd.y = bottom;

       * See which component of our collision vector is smallest

      if (Math.abs(mtd.x) < Math.abs(mtd.y)) {
         mtd.y = 0;
      } else {
         mtd.x = 0;

      /* Return our collision vector */
      return mtd;

7  Game Development / Newbie & Debugging Questions / Re: For advice on where beginners should go to start making games on: 2014-07-07 14:43:39
Watch all these:

Then these:

..and eventually these:

..and bonus: These if you're interested in using slick2d (I recommend LibGDX though, it's more up to date)

If you watch all of those (at least the first two links) you'll have a pretty solid groundwork of java fundamentals. It doesn't cover everything, but it does knock out a huge amount of basics.

Just had a fly over these, short and concise videos. I watched a few of them, stuff I knew but still.

Edit: Oh and yeah, he breaks quite a few Java formatting rules but meh.
8  Discussions / Miscellaneous Topics / Re: Back on the bike on: 2014-06-30 11:30:14
No mountain-biking for me, I prefer riding road bikes Smiley

The seat (saddle?) isn't my problem, since because of the handlebar being very low, I mostly put my weight on my arms and legs and only a little on the seat.

Do that on a mountain bike and enjoy your snapped arms first rock :p

I bike to my classes here in downtown Atlanta. I love it, and hopefully I won't get hit my a car anytime soon Smiley

Chicks dig scars Wink
9  Games Center / WIP games, tools & toy projects / Re: Zombie Nauts [0.4.5] on: 2014-06-27 12:24:03
I've lost absolutely all inspiration. It sucks because I really wanted to finish this game but I can't bring myself to do it. Can someone help me find some drive?

Finish it or I will kill your family while you sleep.

There, sorted.

Seriously though, finish it :p
10  Discussions / Miscellaneous Topics / Re: Get to Work on: 2014-06-26 10:01:57
You !don't deserve my medal.

Just...stop. Please think of the children.
11  Game Development / Game Play & Game Design / Re: The ultimate sandbox game on: 2014-06-25 12:59:01
I agree. I feel like there are too many people trying to emulate other peoples' success without actually innovating beyond a couple of things here and there just so that they can say, "hey, my game is different - early access beta is only $30!".

I will go ahead and build on this with my opinion of a game that does just that.

Starbound, it is clearly inspired by Terraria. However the only thing different from Terraria is the block placing mechanics and the whole travel around planets thing.

Sure it is cool that it is proceduraly generated and I can respect the effort that goes into such code, at the end of the day it is just a standard platform game with Terraria style building and average combat. I actually find the combat to be terribly linear and boring.

The space travel and exploration does not make it "innovative" over previous successes.
12  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-24 12:24:57
Even code I write myself I use private and non specific access fields, why? I come back to the code weeks later and I can't access that field, it was probably for a reason. Some things just should not be changed, even if you know you will forget.

Also I will just come right out and tell you to get the giant stick out your ass, your code is no different from what mine was the day I started coding.
13  Discussions / General Discussions / Re: How do i do vectors on: 2014-06-24 08:15:45

The best math resource you will ever need.

do i need to create my own vector class coos i cant do vec.x or vec.y on this
   Vector vec = new Vector(0, 0);

What? X and Y are just fields in the vector class.
14  Game Development / Performance Tuning / Re: Yet another voxel engine on: 2014-06-22 20:34:28
CPU: Intel i5 4200U @1.6/2.55Ghz
GPU: GT745m 850mhz (Not sure if memory or core?) or Intel 4500

Solid 60FPS. Both chipsets.
15  Discussions / General Discussions / Re: How to stay focused.. on: 2014-06-22 20:24:22
When I was unfocused, I started a second project that interests me. Since I'm working on that, it motivates me to continue the original project.

Vicious cycle, would not suggest this.
16  Games Center / WIP games, tools & toy projects / Re: [Slick2d] Retro-Pixel Castles >>MAP EDITOR TECH DEMO RELEASED!!<< on: 2014-06-22 18:22:47
I like your UI, it is quite nice and polished. Simple (not in code ofc) but pleasant to look at.

It has a nice "feel" to it, the only thing is that the whole thing seems utterly pointless as it stands right now and I lost interest in it within about 30 seconds. Once it has more purpose and it is implemented into the game itself, in a way we can use; it will be good.
17  Game Development / Newbie & Debugging Questions / Re: Convert Screen coords to World Coords LIBGDX on: 2014-06-22 18:20:32
All you have literally got to do is this:

Vector3 touchPos = new Vector3();

touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);


codeYouWantToUseTheseCoords(touchPos.x, touchPos.y);

That is pretty much it, you take your custom camera and unproject any on screen touch/click events, then you can use these coords.

I do this to create level layouts in my little breakout clone, it does not matter what the screen resolution is since you are forcing it to use 480x800 anyway, it is a fixed viewport. Also most phones use 16:9 aspect ratio, you would be tailoring it a very small majority and imo it is not worth the fuss.

Code your game for whatever device you have, worry about it later.
18  Game Development / Newbie & Debugging Questions / Re: Tile Placing on: 2014-06-22 11:50:33

There is really no point in providing code like this, the op will never learn anything.

ArrayLists are basic Java, they are imo one of the simplest collections to use. Simply add stuff to it and let it go, everything else is handled.

The OP needs to revise a little more. No offense OP, I too had problems like this at first, I took a massive step back and spent a month or so studying Java. I understood how to init and use various Java objects, how to use them in a game was another thing.

I am not quite sure you are past the initial part yet.
19  Games Center / Showcase / Re: RebelChick - Now Available for Android & IOS on: 2014-06-21 20:33:38
Flappy bird clone with an actual story, I like it.
20  Game Development / Newbie & Debugging Questions / Re: How to create games like .. on: 2014-06-21 20:31:43
Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.

This stuff simply can't be learnt just by reading, you need to do.

You want to learn how to load levels via external files? Create a level editor, save the information and code a way to load it back in.

You want to learn about handling entities? Look at other peoples code, steal it and adapt it. Seriously.

All the things you mentioned are learnt via trial and error, reading about them alone won't get you anywhere.

I suggest using LibGDX if not already, it will probably help with the lag problem.
21  Game Development / Newbie & Debugging Questions / Re: A fatal error has been detected by the Java Runtime Environment with LibGDX on: 2014-06-20 22:20:38
Remove all the dispose calls, see if it works. Add them back one at a time until it crashes.
22  Game Development / Newbie & Debugging Questions / Re: When would one be ready to create advanced game engines on: 2014-06-19 09:47:31
I have been programmer for around the same time as you.

However I am 22 years old, I find it ridiculously easy to learn things. More so than I did 10 year ago.

When I was in school I struggled with Maths class, now that I look back on's not that I could not do it, my attention span to something I presumed I would never need was rather low. I was an idiot.

I've never made a large game engine, my game engine is extremely small. It simply consists of around 5-6 classes, all these do is enable me to have the graphics, physics, input and audio to all talk to each other in a clean manner; as in not calling audio methods inside some other random class. That is to me, a useful but small game engine.

Ain't no harm in doing something like that, to make your projects a little easier. Hell I have used this little engine for 3 games so far, none are finished ofc lol.
23  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Gdx.files.local doesn't seem to be finding my files. on: 2014-06-19 09:36:39
Those folders are not in the root folder, they are setup in the build path of your project and are wrapped with the .jar. Therefore they are internal files.

Just put things in the Assets folder of the android project, LibGDX is cross platform and all the folders are linked. Anything in the assets folder gets copied over to an assets folder for whatever platform you are exporting to.

You would use gdx.file.local when you want to receive files in the directory the jar is present like you said, say your game has an installer and everything is outside the jar, you would use this.

Please don't call these methods stupid because you don't understand it, if you don't like it use your own API.

EDIT: Gdx.files.internal will only find files that are linked as a source folder, i.e the Assets folder.
24  Games Center / WIP games, tools & toy projects / Re: Zombie Nauts [0.4.5] on: 2014-06-18 21:34:50
I have a suggestion for your wave system.

Have wave levels such as this:

  • Wave 1-5 - Basic Zombies, various speeds, increase spawn rate per wave
  • Wave 5-15 - Basic Zombies + New type, various speeds, start spawn rate at % of total previous wave + base spawn rate
  • Wave 15-30 - Basic Zombies + Zombies from previous waves + New Type, various speeds, start spawn rate at % of total previous wave + base spawn rate
  • Wave 30-45 - Rinse and repeat

Make your score more interesting, take the current wave level, take a small % of it and take the zombie score and multiply it by that. This will give varied scores and higher scores as the waves get harder without too much tweaking.

Make it do this until you have introduce every single zombie type, add bosses at increments of 50 or a desired number.

How you want to implement weapons is up to you and dependent on how many you plan to add.
25  Discussions / General Discussions / Re: Java 8 on Raspberry Pi on: 2014-06-18 20:57:23

It's essentially a £20 was not designed to use accelerated graphics.
26  Game Development / Newbie & Debugging Questions / Re: Is this a bad design? on: 2014-06-18 18:26:56
Why use an interface? Why does it have getters and setters? This would require you to set those up everytime, to most likely get the same fields.

Why not just have a concrete class called GameObject, have it store fields that all objects will have. Maybe make it very generic so that more specific objects can extends and build from it.

If you need methods to be forcefully inherited by sub class, just make them abstract.

I do not see the need to use an interface here, unless I am missing something.

From what I have learned, you use interfaces to provide a public API and you should not heavily design with them. If it is only you that will use the code, then it is pointless. Exceptions are things such as callbacks or events, if you have a game that runs off events and all events need to use the same methods, then an interface can be very useful.
27  Game Development / Newbie & Debugging Questions / Re: WASD Movement - Questions on: 2014-06-18 07:46:51
The only difference in the atan2 function is that you won't get divide by zero errors, because it does a check.

This, there is literally no reason to use atan if you got atan2.
28  Discussions / General Discussions / Re: How to stay focused.. on: 2014-06-18 07:41:51
Cocaine, it's a hella drug.

On a serious note, write down some realistic targets and deadlines. I cannot express hire much this helps.
29  Games Center / WIP games, tools & toy projects / Re: Zombie Nauts [0.4.5] on: 2014-06-17 18:41:54
Ya that is the main menu screen. The buttons and everything are very ugly. Just click inside the rectangles.

IMO remove that for now and just go straight to a paused state on a new game. These are alpha tests builds, keep it simple.
30  Game Development / Newbie & Debugging Questions / Re: [math] Calculate velocity on: 2014-06-17 12:56:30
Always run simulations at a constant time step.

So for anything physics based never use delta time? Use a fixed time step?
Pages: [1] 2 3 ... 24

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (26 views)
2014-07-24 15:59:36

Riven (25 views)
2014-07-24 11:16:32

Riven (20 views)
2014-07-24 11:07:15

Riven (22 views)
2014-07-24 10:56:16

ctomni231 (51 views)
2014-07-18 20:55:21

Zero Volt (46 views)
2014-07-18 13:47:54

danieldean (37 views)
2014-07-18 13:41:23

MustardPeter (40 views)
2014-07-17 13:30:00

Cero (56 views)
2014-07-16 14:42:17

Riven (55 views)
2014-07-15 08:02:53
HotSpot Options
by dleskov
2014-07-08 17:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 14:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 14:47:22

How do I start Java Game Development?
by ra4king
2014-05-18 01:13:37

HotSpot Options
by Roquen
2014-05-15 23:59:54

HotSpot Options
by Roquen
2014-05-07 05:03:10

Escape Analysis
by Roquen
2014-04-30 12:16:43

Experimental Toys
by Roquen
2014-04-29 03:24:22 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‑
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!