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 4
1  Games Center / Android Showcase / Re: Rocks Fall on: 2014-07-17 12:22:54
As you are lonely in a cave and try to find your way out I think this game might work well with atmospheric background music and sounds. Not too much rythm and melodies. Keep it organic and the tone should be more dark than nice Wink I just looked a bit on soundcloud and found a nice example.
Listen to the parts from ~15:00-23:00 or ~ 33:00-39:00. This music gives me a very eerie feeling and I would find something similar very fitting for the game.

Also, I would add a lot of random sound effects to it. Sounds of dripping water, howling wind, bat sounds etc. what ever could fit in the cave scenario... Don't overdo it and make sure that it fits in (play around with the volume, add reverb to it etc.) Don't try to use repeating patterns.

About the rotation. I played a game that has been made for ludum dare 29 that has a similar mechanic, where you rotate the screen and change the gravity with that. The game is a bit different but I think the rotation works quite well there and the cut is not as harsh as in your version. You can check that out and see if maybe something similar would fit for your game.
2  Games Center / Android Showcase / Re: Rocks Fall on: 2014-07-16 18:39:05
I tried your game and it's just the right thing to play on a short bus or train ride. Haven't got very far yet (lvl Cool.

Need to get of my train in some minutes so my feedback in short:
+ The idea for the game mechanic is nice and I like the puzzles so far.
+ The difficulty starts low but then i gets harder. I think after lvl 5 i wasn't able to solve a level in the first try.
+ No special permissions needed. Make an ad based free version, but there always will be some guys like me who are willing to pay a bit and in turn don't need to give the application special permissions.
- No sound
- i hit the back button. This exited the game and all my progress got lost. Tr to improve the app lifecycle here. Maybe you could autosave after each level. I can imagine that some players will be discouraged if they solved 30 levels in one session and then lose the whole progress.
- The rotation happens instantly. Sometimes I hage trouble with that. Can't describe exactly what it is. Maybe rotate the level instantly, but use an animation to rotate the player afterwards. I think this would look a bit better.

I think this game has a very good potential if you polish it a bit. I'm definitely lookin forward to beating your 123 levels Cheesy
3  Games Center / WIP games, tools & toy projects / Re: [Slick2d] Retro-Pixel Castles > NEW EDITOR RELEASE: 7-10-2014!! < on: 2014-07-12 22:36:27
I too like the web page but there is one thing bothering me with it. I have a full hd screen, but because of the header, logo, navigation and breadcrumbs, only the lower third of my screen is used to display actual content from your page (don't forget that the window chrome of your browser or windows taskbar also use up vertical space). You are wasting valuable space that you could use to display content. You could still make a nice home page with a big logo, but I would make the whole heading section more compact for all other pages.
Other than that your page looks neat and I think it fits nicely for your game.
4  Game Development / Newbie & Debugging Questions / Re: Tile Placing on: 2014-06-20 16:58:38
It seems to me that you are not fully understandinging what you are doing. You haven't posted all relevant code, so i can only guess. I think your problem is that you have only one instance of your skyscraper (the variable s in the second method). You don't create anything in the methods you posted. You only change the coordinates, which would explain why the existing tile is moved. You have to create an instance for each tile you want to create...
5  Discussions / Miscellaneous Topics / Re: Interesting Profile pictures on: 2014-06-18 12:26:15

I love londo. He and g'kar are my favorite characters from the show Smiley always liked your avatar XD
6  Game Development / Newbie & Debugging Questions / Re: Differentiating between different types of Box2D bodies in LibGDX on: 2014-06-08 16:41:44
I don't know how you handle your collisions, so I can't say much about how you could do it (maybe explain how you setup your resolution or provide some code).

About your suggestion. You can attach multiple fixtures to a body, but as far as I know you can only attach one user data object per body, so I think that your approach won't work.

In my game I too need to check what bodies have collided. I have an event queue where I can push events on to, if I found a collision that needs to be handled by one of the game systems. For this I created an implementation of the ContactListener class. In there I check the entity types of the bodies. If I find a combination of entity types that I need to handle, I simply put them into the queue. No need for global variables, as I supplied the event queue in the constructor of my ContactListener implementation.

I have put up the (stripped down) code of my implemenation:
My code is a bit special (let's call it ugly Wink ). Also my solution is by all means not optimized. There are some things I could do to improve, but currently it is out of scope for me and as long as performance is no issue I won't bother changing it Wink I hope this gives you an idea on how you could do this.
7  Game Development / Newbie & Debugging Questions / Re: Differentiating between different types of Box2D bodies in LibGDX on: 2014-06-05 22:32:46
I just have been informed that I should read a bit better next time...

You could create a hashset for each entity type and register the bodies on creation in that set. Or use a HashMap with the body as key and your entity as the value.

He just explained that some gfx lib is claiming this userdata field persecutioncomplex

Indeed. Must have have missed that whole paragraph  Roll Eyes Time to go to sleep...
8  Game Development / Newbie & Debugging Questions / Re: Differentiating between different types of Box2D bodies in LibGDX on: 2014-06-05 22:20:02
There are multiple ways to do this. The easiest way would be to user the user data property for the body. You could create an EntityType enum and then simply set the values as user data, if you only need the types:

//Set the user object

//check the user object

Have a look at this tutorial: . It explains what filter groups are. Maybe this could be also useful for you. Definitely worth checking out.
9  Discussions / Miscellaneous Topics / Re: Code-style: Cringe pics on: 2014-06-05 17:11:55
I had to maintain a js project once that had a very special way of doing things. Can't post actual code from the project, but it looked something like this:

for(var arrIndex = 0; arrIndex < arr.length; arrIndex++){
   for(var arrFooIndex = 0; arrFooIndex < arr[arrIndex].length; arrFooIndex++){
      for(var arrFooBarIndex = 0; arrFooBarIndex < arr[arrIndex][arrFooIndex].length; arrFooBarIndex++){
         arr[arrIndex][arrFooIndex][arrFooBarIndex]['Property'] = 'yay';
         //Lets loop some more ;)

Now imagine this going down up to 10 levels of nesting and add a bit of business logic into each layer, often referencing the objects of other layers. The project was very well documented and structured, but things like this required that you had to be extra careful with every little change. It didn't help that there was very much redundancy, so often you had to change multiple loop trees, if you needed to change something.

Another thing that annoys me very much (it might be a bit off topic for code style) are date parsers in javascript. Somehow people resist using already established solutions and try to roll their own. And this is really hard to get right, especially if you you take different locales into account. In one project I had to help out with a problem on the frontend with datepickers, I found three different implementations (let's call them hacks) of a dateParse method, each one used in different places of the application and one of them actually returned the correct dates sometimes... Fun thing is that this application ran on a platform, that had a js api and provided full support for localized dates and some other nice features. But hey, why not roll your own?

I once read a nice quote, sadly I can't remember where I read it, but it fits nicely for this post:

Write your code like if the person maintaining your source is a total psycho and knows your home address.
10  Game Development / Newbie & Debugging Questions / Re: [libGdx] friendly group example on: 2014-06-03 17:36:17
I have no Idea but maybe try out this:

stage = new Stage(new Viewport());

The part with stage and viewport has been introduced sometime before the 1.0 release of libgdx. Viewport is just an interface as far as I know, so you can't create it directly. Check the libgdx docs which viewport would suit you best (I tend to use the ScalingViewport):
11  Game Development / Newbie & Debugging Questions / Re: LibGDX - Tiled collisions? on: 2014-06-02 12:08:13
You need to compare the coordinates of the colliding wall and on the coordinates of your player (the center of your player sprite). Then you just have to compare x and y values of both.

If the wall x is smaller, it is to the left. If the wall x is higher than player x, then it is to the east.

The same goes for y. It wall y < player y the wall is to the south.

Then just move the player in the opposite direction until the collision has been resolved.
12  Discussions / Miscellaneous Topics / Re: Random syntax tweaks! on: 2014-06-01 23:01:31
This ?? operator just tries to hide a problem instead of fixing it. Getting rid of null and using something like a Option type is way better in my opinion.

Exactly. It's called the Billion Doller Mistake by the "creator" of
, Tony Hoare.

While I won't comment on the issue of having null references at all (I don't know enough about the issue to make an useful statement), we have to deal with null references anyway, no matter if null references are a good design decision or not. The coalesce operator can help shortening code (at least I have seen many places in production, where this operator was applied or could have been used to make classes morre concise). So while it might be here to counter bad design decision in our programming languages, I still find it a very useful small tool. I definitely can live without it in java, but I like getting rid of useless clutter. If there is a simpler way of expressing code that has a similar readability, I'm happy to use it, and this applies to ?? if you use it at the right places.
13  Game Development / Newbie & Debugging Questions / Re: LibGDX - Tiled collisions? on: 2014-06-01 16:19:01
If you look into box2d I think the most valuable help to start is the main manual, even if the code is slightly different (c++ instead of java).

The basics of box2d are very well explained. When you think you understand what is going on, you can have a look at the libgdx wiki on how to setup box2d for libgdx =>
Then you can try implementing the examples from the manual.

Just so you don't mess up the game, I would create a new test project, where you try out your first steps with box2d and when you think you understand what you are doing, you can integrate it into your game.
14  Discussions / Miscellaneous Topics / Re: Random syntax tweaks! on: 2014-06-01 15:45:02
A very simple one that I miss in java is the ?? operator from C#. If used at the right places it can make the code more concise without loosing any readability.

The ?? operator is called the null-coalescing operator. It returns the left-hand operand if the operand is not null; otherwise it returns the right hand operand.

Here is a silly example:
public class Foo
   private string _instance;

   public string GetInstance1(){
      if(_instance == null){
         _instance = "instance";
      return _instance;

   public string GetInstance2(){
      return _instance == null ? (_instance = "instance") : _instance;

   public string GetInstance3(){
      return _instance ?? (_instance = "instance");

15  Game Development / Newbie & Debugging Questions / Re: LibGDX - Tiled collisions? on: 2014-06-01 15:11:32
Detecting collisions is actually not that hard. The problem is how you resolve the collisions. Just stopping the movement will most likely get the player stuck in the wall. If you are using libgdx you could save the time on implementing something yourself and use box2d to do the heavy lifting for you. A friend has started using it for his 2d oldschool rpg (something like the first zelda games) and it works quite well. Cool part is that you can use an object layer in tiled and simply draw the collision boxes with rectangles / polygons and import them into box2d. I have done this once by hand, but since then I learned that libgdx has a class to do exactly that.

If you just want to make a simple collision detection, you could use two Rectangle (com.badlogic.gdx.math) instances. Use a loop to cycle through each neighbour tile and check if the entity intersects with it. If the checked neighbour is a wall, assign size and position of the entity (player) you want to check to the first rectangle, and the same for the wall to the second rentangle. Then you can call rect1.intersects(rect2) to check, if they overlap. Just store the walls that have intersected for later resolution.
To resolve this, you can loop through the walls that have intersected and move the player one pixel away from the walls. Do this until the player isn't stuck anymore.

This is a very basic method of doing it and only will work, if the walls are full tiles and the entity (collision box) is smaller than a tile. I'd still recommend using box2d though Wink

EDIT: I'm also not sure how to make the rectangles relevant to tile positions

As for your problem, usually you need the tile size and the x and y position in the layer to calculate the pixel based position. I modified your code to show how to get the x and y positions of a tile.

float tileWidth = layer.getTileWidth();
float tileHeight = layer.getTileHeight();
for (int y = 0; y < layer.getHeight(); y++) {
   for (int x = 0; x < layer.getWidth(); x++) {
      Cell cell = layer.getCell(x, y);
      if (cell != null) {
         TiledMapTile tile = cell.getTile();
         if (tile != null && tile.getProperties().containsKey("Blocked")) {
            float tx = x * tileWidth;
            float ty = y * tileHeight;
16  Games Center / WIP games, tools & toy projects / Re: Treasure Catcher - Mini Game on: 2014-05-31 18:40:05
Looks nice for a first game. You definitely have to add some powerups or other enemies to add more variation to the gameplay. You might consider having different speeds per lane, to make things a bit harder.
17  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Unsupported major.minor version 51.0 problem on: 2014-05-30 21:18:04
I am very new to gradle and maven, so I'm not sure if this helps. But it looks to me that you have configured a wrong robovom version in your build.gradle file.

Check your build.gradle file in the root of your project. Somewhere at the start you specify which robovm version you are using. It seems to me that you have set it to version 51 (which should be jdk7s versoin number, if I'm not mistaken). I have it set to 0.0.11

allprojects {
    ext {
        appName = 'xxx'
        gdxVersion = '1.0-SNAPSHOT'
        roboVMVersion = '0.0.11'

Provide more information if that doesn't help. What version of libgdx are you using? Are you using the old ui based setup or the new gradle based? Maybe post your file if you are using gradle build.

I just have seen an update on the libgdx page =>
Note: it is very important that you update to the latest RoboVM Eclipse plugin if you use Eclipse!
18  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [libgdx] Drag and drop with scene2d tree on: 2014-05-23 17:36:38
Nice, thanks. This is a better than my solution, as it selects the hovered node, when it is not selected yet. Definitely better from a user perspective, as the user now sees clearly which node he is moving.
19  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [libgdx] Drag and drop with scene2d tree on: 2014-05-23 17:07:49
Hey thanks very much, I got it working now how I wanted.

In the source, use the selected nodes for what to drag (can select the node under the mouse if nothing is selected).

Here I don't use the selection because the selection is only updated after the drag started. Means if I select the third node but then go with the mouse over the second node and start dragging, still the third node would be dragged, which is a bit strange.

Other than that it worked great for changing the parent. I needed to add some more code to enable the reordering.
20  Java Game APIs & Engines / Engines, Libraries and Tools / [libgdx] Drag and drop with scene2d tree on: 2014-05-22 16:20:08
I'm working an an editor for our game. A main component of the editor is a tree, that displays nodes.

The editor must be able to reorder nodes in the tree or move entire branches onto a different parent node. To do this I see two possibilities:
1. Implement it with drag and drop, so the user can just drag a node and move it to the appropriate position.
2. Add up/down buttons to the nodes for reordering and add a new button to change the parent of a selected node.

While I would want to do it with drag and drop, I don't want to spend too much time on this (we need to concentrate on the game itself, this would simply be a nice to have). Does the scene2d tree actor support drag or can someone point me into the direction on how to do it, so I can see if it is too much effort to do?

I have seen that LibGDX has a DragAndDrop class. From what I see in the DragAndDrop test ( ) I could do something like this:
- Create empty nodes (drop target) around normal nodes in the tree. These are used to preview where the node will be inserted to. (I created an image to illustrate this . The red lines represent those drop target nodes).
- When a node is dragged, remove it temporary from the tree (or hide it).
- When the drag is released, a check needs to be made if the target is a valid position. If so then move the node to that position. If the position is invalid, the node is put back at the original place.
- When moved, some drop targets need to be added / removed.

Am I completely on the wrong track, or would this be the way to go?
21  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Stage wont stop acting? Input handled on wrong screen on: 2014-05-22 09:07:43
Either there should be a method setEnabled or setDisabled on every actor (table is also an actor). You can deactivate it with that method, wich also deactivates input handling. If you don't draw the stage at all then you should call Gdx.input.setInputProcessor(null) when you enter the gameplay state. If you want to go back to the main menu, then you would need to call setInputProcessor with your stage as parameter.
22  Discussions / Miscellaneous Topics / Re: Crazy Mouse problems on: 2014-05-22 09:00:30
I almost threw my notebook at the wall out of anger because of this. My touch pad is so sensitive that you almost can't work with it enabled. Some touchpads allow to configure the touch sensitivity. This might help.
23  Game Development / Newbie & Debugging Questions / Re: Calculating probabilities - is this the right way? on: 2014-05-16 15:42:49
Thanks for the hint. I know my method is in no way optimized Wink I'll have a look at your link this weekend. I always wondered how to improve that, but as I only use it in non performance critical places I never bothered to change it...
24  Game Development / Newbie & Debugging Questions / Re: Calculating probabilities - is this the right way? on: 2014-05-16 14:08:52
This is my generic approach to do those things:

Create a weighted list object of the type you want to create, add all possible values with their respective weight. When you want to create an item just call list.get(random).
25  Game Development / Game Mechanics / Re: [LibGDX][Box2D] What method of capping angular velocity/force on: 2014-05-13 12:58:16
I use the method described above to cap the speed. As I understand the damping is a way to slow bodies (or their rotation) over time. You can check out my LD29 game ( ). I used a very low damping value, so the cells in the game continue to drift in the same direction, even if the player stops pressing the direction keys. It creates quite a floaty feel to the game.

I'm getting to know box2d a bit better by building a pong game. There I also linear use damping, but for the paddles. The damping value is quite high. With this the player can release the direction keys and the paddle will still slide a bit further in the direction instead of stopping instantly.

So I think the damping is a very valuable tool in box2d. You have to try out what parameters work best (keep in mind that the strength of the damping might also be related to the mass. more mass => damping has less effect. I'm not sure about this but it would make sense).

But I don't use the damping to limit the speed. I think it is the wrong tool for that.

Please take my advice with a grain of salt, because I just started using box2d some weeks ago.

And if you want to stop your bodies from rotating, then you can use body.setFixedRotation
26  Game Development / Game Mechanics / Re: [LibGDX][Box2D] What method of capping angular velocity/force on: 2014-05-13 11:13:11
I do the following to cap my max speed:

Vector2 velocity = body.getLinearVelocity();
float speed = velocity.len();
if (speed > MAX_SPEED) {
    body.setLinearVelocity(velocity.scl(MAX_SPEED / speed));

Edit: Ah sorry, just have seen that you asked for angular velocity in the thread title. The angular velocity defines how fast an object rotates. Not sure if this is really what you want, but if so, you can do basically the same thing, as for the linear velocity. The check needs to take into account, that the velocity can also be negative, but other than that it's the same logic.
27  Games Center / Showcase / Re: Super Spineboy on: 2014-05-12 22:05:15
Oh sorry, you are right. I see it now. I think I have started to shoot and then pointed down in all my maximized windows test. False alarm Wink
28  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Nested Tables Rendering incorrectly on: 2014-05-12 21:47:56
Can you show the code of your GridSceneBoard. It's hard to say without knowing how the scene is created.

Try to remove the setFillParent call on the game board. I'm not sure if it was just me beeing dumb, but I didn't get it to work like that. I only use the setFillParent method on the root table.

Change your add line to this:

The root table will do the layouting for the child table.

Make sure you check out the tutorial on the table layout github page:
29  Games Center / Showcase / Re: Super Spineboy on: 2014-05-12 19:04:42

If you maximize the window (not fullscreen with alt+enter), the mouse aiming won't work correctly...
30  Game Development / Newbie & Debugging Questions / Re: [LWJGL][LIBGDX] window drag problems. on: 2014-05-12 01:03:42
I think you can fix this by settings the backgroundFPS to -1 in your LwjglApplicationConfiguration (in your desktop launcher).


   /** Target framerate when the window is not in the foreground. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
   public int backgroundFPS = 60;
Pages: [1] 2 3 4

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 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (20 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

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

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

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

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

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

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

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

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

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13: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!