Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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]
1  Discussions / General Discussions / Re: Free GitLab Offering on: 2013-11-11 23:38:23

just want to give a comment about the https stuff as i have setup gitlab on some company servers:

In short: The person handling the server (the OP in this case) is responsible for security and for making gitlab work over https.
There are some tutorials on the internet but not that many, as the gitlab guys mainly make money through support.
If the OP needs some assistance, here is a tutorial for https: or he can PM me (installed it on debian + nginx / apache) or just use  good'ol google  Smiley

Please be aware that the hoster has full control over the data you upload there.

@OP: If your handing gitlab accounts to strangers be sure to keep it as up to date as possible (imho 6.2.3) and have a tight security around the elements gitlab uses because holes an such :>
2  Game Development / Newbie & Debugging Questions / Re: Fast way of rendering Tiles. on: 2013-09-26 16:54:53
I suggest while you are working on the map generator you immediately set it up to seperate your map into chunks/rooms.

Chunk[][] chunks; // Your World / Level / Map
Tile[][] tiles; // One Room/Chunk of the Map

First you would need to check in which chunk you are:
int currentChunkLeftX = (int) playerPositionInWorld / MAP.CHUNK_WIDTH // Do this for all 4 edges of your camera. You might be in 2 chunks at the same time. 

For each chunk you are in you calculate the 4 edges again (yTop, yBottom, xLeft, xRight) and only render the part visible for the user
foreach chunk you are in do:
    for(int x = leftEdgeX - 1; x < rightEdgeX + 1; x++{
        for(int y = bottomEdgeY; y < topEdgeY; y++ {

As Gjallar stated this will save you a lot of computation time  ( O(n) versus O(x) where x = numberOfVisibleTilesToRender)
3  Game Development / Newbie & Debugging Questions / Re: LibGDX - Collisions using Rectangles inside ArrayLists with Iterator on: 2013-09-19 15:27:31
Ah there you got me Wink
4  Game Development / Newbie & Debugging Questions / Re: LibGDX - Collisions using Rectangles inside ArrayLists with Iterator on: 2013-09-19 13:56:08

It tought of it this way:

Loop Asteroids {
   Loop Shoots {
        checkForCollisions(); remove Asteroid && Shoot;

If the collision happens: We remove the asteroid and the shot.
If we would continue; we would just check collisions with the next bullet, but the same asteroid (that we just removed).
If we break; we leave the shots loop and skip to the next asteroid.

Or do i just have a big brain f*rt? Smiley
5  Game Development / Newbie & Debugging Questions / Re: LibGDX - Collisions using Rectangles inside ArrayLists with Iterator on: 2013-09-19 13:44:19
It seems to me that your problem is the position in the code of your
if(asteroid.overlaps(shot)) { iter.remove(); }

A solution would be:
Iterator<Rectangle> iter = asteroids.iterator();
      while(iter.hasNext()) {
          Rectangle asteroid =;
          if(asteroid.y < -64 || asteroid.overlaps(playerShip)) {
              iter.remove(); continue(); // We continue because the asteroid has been remove & can't collide with a Shot
          Iterator<Rectangle> shotIter = shots.iterator();  // Loop of shots to check if they collide with the asteroid
          while(shotIter.hasNext()) {
              Rectangle shot =;
              if(shot.y > 600) {
                  shotIter.remove(); continue; // Remove the bullets as it is out of screen
              if(asteroid.overlaps(shot)) {
                  shotIter.remove(); iter.remove(); break; // Again no need to check for further collisions with this asteroid because it has been removed

6  Java Game APIs & Engines / JInput / Re: On button release on: 2013-08-12 16:59:18
boolean lastTimeButtonPressed = buttonPressed;
buttonPressed = checkIfButtonIsPressed();

if(lastTimeButtonPressed && !buttonPressed) {
    System.out.println("The button has been released");
7  Java Game APIs & Engines / JInput / Re: On button release on: 2013-08-12 16:50:12
A way to do it:

Have a boolean buttonPressed which you set to true if the button is pressed.
If the boolean changes from true to false you know the user released the button.
8  Games Center / Cube World Projects / Re: Troubles with the 3D Camera on: 2013-08-11 15:51:08
Your forward is not fixed.

You give the movement direction as a fixed angle (0, 90, 180, ...) - this will result in moving along the z & x axis.

You have to calculate your direction every time you turn your camera.
9  Game Development / Newbie & Debugging Questions / Re: How do you handle loot tables and drop chances? on: 2013-08-09 04:19:10
Here is how we did it some years ago - This was for a game with lots of items

We had a Webinterface on which we could add items to a Boss / Mob. The Lootable could be exported and looked kind of like this:


Every time a boss was loaded (start of level) , a random number between 1 and 100 was drawn for each item on the list.
DropChance was multiplied by the random number. If it was >= 1 we added it to a Collection.

Every Boss/Mobb had a chance to drop say 3 -6 items.
We would than randomly pick (random.nextInt(3) + 3) items from that Collection and wait for the boss to go down.

In the loottable were always enough dropChance = 1.0  items to guarantee something would drop.

Crazy times... Smiley
10  Game Development / Newbie & Debugging Questions / Re: [LibGdx]Doesn´t understand Camera + Noob Questions on: 2013-08-07 17:22:42
Let's assume you have a Map with 1000x1000 pixels (in this case a Sprite Image with 1000 width & 1000 height)
Your screen with is 1280x720

[in your show / create method]
cam = new OrthographicCamera();  // The camera will take the viewport (what you can see looking through the camera) of the screen size (1280, 720) if you don't specify otherwise
cam.setOrtho(false); // We want (0,0) in the bottom left corner
cam.position.set( / 2, / 2, 0); // this will render the camera so that 0,0 (of everything inside batch.begin() - batch.end()) will be rendered at 0,0 on your screen
cam.update(); // Updates the camera

[in your render() method]
cam.position.set(x, y, 0); // x and y could be changed by Keyboard input for example
cam.update() // Don't forget me ;)
batch.setProjectionMatrix(cam.combined) // Tells the spritebatch to render according to your camera
batch.draw(map, 0, 0);  // Draws your map at 0,0 - width expands to the right, height expands up

unproject will convert for example your mouse coordinates to world coordinates:
If you for example scroll up on you map: 0,0 on your screen will be 0, 100 on your map image (we scrolled the map 100 pixels upward)
If you now would click on 0,0 on the screen without unproject, it will give you 0,0 as a result. But if you do cam.unproject(mouseClickedPosition) it will give you  0, 100

Hope this could help you : )  (and is right. not in front of eclipse right now)
11  Discussions / General Discussions / Re: Is like github for java where you can store private projects for free? on: 2013-08-07 02:12:26
For how git works it is best to watch a short video on youtube about it.

Mainly it allows you to keep track of your versions, changes, functions et cetera.

Git is a bit hard to learn, and way harder to keep yourself disciplined to use it. But has many benefits.

If you want to use something with the look and feel of github but want to have private repositories i would recommend
It offers wiki, issue tracking and much more

I used it before i setup my private gitserver (Gitlab) and was very satisfied.

One of the main reasons i use git is that i can experiment with the code and then rollback if it was a mess (without having to edit files, change a folder etc) or merge it with my 'stable' code
12  Game Development / Newbie & Debugging Questions / Re: Online secure databank for usernames and their passwords? on: 2013-08-05 20:40:20
Here is how i do it:

I create a MySQL Database** on the server where my game server is running. Where i store hashed password (sha1, bcrypt, ....)

- User enters username & password
- Username and hashed password are send to the server
- Receives username & hashed password
- Server finds the username in the database an checks if the hashed password in the database matches with the one received from the client *
- Server sends client an "OK, GO" &  a session token.

Every further communication between client & server must pass token verification(clientToken == serverTokenForThisClientID)

To further secure this you should use SSL to encrypt the connection.

* This can be done over an API (i.e. verify.php?pass=$somehash&user=Herp ) if you don't want any mysql connections in your java code (where you would have to hardcode the password in)
** As secure as the server it resides on & the passwords/methods you chose for accessing it  (I.e. prevent mysql injections, limit login attempts, ...)
13  Games Center / WIP games, tools & toy projects / Re: Boris - A 2D Tower Climber on: 2013-08-03 15:50:16
@ Window re-sizing: Yes the game completely freezes. Happened first time at the very start of the level. (No enemies, particles, ... on the screen)

The enemies are a real PITA ^^ I just try to get to the door as my health resets in the next level Wink

Now i can destroy them. Either it was a bug or i was just too stupid ^^ It is kinda hard to aim. the 3 bullets you shot rarely end up where your aiming at ^^
14  Games Center / WIP games, tools & toy projects / Re: Boris - A 2D Tower Climber on: 2013-08-03 15:18:51
Sweet Smiley Nice work!

Random map generation?

Some issues:  (Using Win7 64)

- I started the launcher: It notified me that i hadn't downloaded the game but wouldn't do anything. So i clicked on play an it downloaded boris.jar into the my %appdata% folder*. The play button stayed grayed out and nothing happened. Restarting the launcher didn't do anything.
Opening %appdata%/boris it had 3 empty folders in there (bin, saves, mods) and a tmp folder from which i could start the game. The tmp folder contains your .dlls and boris.jar

- The Launcher doesn't re size itself to fit in the elements (browser)

- The game freezes add random points. Only could replicate the behavior where it freezes sometimes when i re-size my window

- The fact that your arms & weapon are seperated from your body looks kinda wierd Smiley

- Most enemies kill themselfs when shooting at me (for the first time)

The fact that i can't destroy the spawers is annoying - like that Cheesy

* I really don't like when apps (without a nice uninstaller) do this : / But thats a personal preference.
15  Game Development / Newbie & Debugging Questions / Re: Does eclipse have an auto info feature?[SOLVEd] on: 2013-08-03 01:33:53
I like this licence:
16  Games Center / WIP games, tools & toy projects / Re: Horde 8-Bit Waves Of Death! - [WIP UPDATED JUNE 26 2013] on: 2013-08-02 20:00:14
"unlimited bandwith and disk space" *cough* yeah, sure Wink

@ Wesley :

With Distro he means Linux Flavor, for example, Debian, Ubuntu, Mint, Archlinux

Web Engine, A.k.a Webserver is the application you use to serve your website to users. Like Apache, nginx, ...

Btw i would not endorse sth i just happen to know for some small time Wink
17  Game Development / Newbie & Debugging Questions / Re: LibGDX error : Camera setup on: 2013-08-02 13:27:04
If you are loading your Sprites through a TextureAtlas:    //  (this is good practice right? Wink )

TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("data/pack.pack"), true);

The last boolean will flip the y in your whole textureatlas. C.f.:, boolean)
18  Game Development / Newbie & Debugging Questions / Re: LibGDX error : Camera setup on: 2013-08-02 13:22:01
sprite.flip(false, true);

or do it in your graphical program.
19  Game Development / Newbie & Debugging Questions / Re: LibGDX error : Camera setup on: 2013-08-02 02:54:57
Have you added:
20  Game Development / Newbie & Debugging Questions / Re: Always Left with TouchDown Click on: 2013-08-01 20:22:55

(I suppose this is the problem)
you have to convert the mouse coordinates to world coordinates:

Vector3 touch = new Vector3(screenX, screenY, 0);
camera.unproject(touch); // Your OrthographicCamera
Vector2 vec2Touch = new Vector2(touch.x, touch.y);

then you can check on which side of your player your mouse coordinates  are

if(vec2Touch.x > getX()) {
21  Games Center / WIP games, tools & toy projects / Re: Horde 8-Bit Waves Of Death! - [WIP UPDATED JUNE 26 2013] on: 2013-08-01 18:53:48
Hi Wesley.

By default subdomains work without www infront:

(you can change this however by adding
into your vhost config (if you are running apache as a webserver)

Keep up the good work Wink

P.S.: A small request: Could you please upload the file to your server (i.e. instead to such a site as mediafire. Much more clean Smiley

22  Game Development / Newbie & Debugging Questions / Re: Good examples of 2D game engine architechture. on: 2013-08-01 13:48:16
As Mr. Cas is not around i just leave this here:

Source of Revenge of the Titans

P.S. I like reading code. Moar sources plz ;>
23  Games Center / Archived Projects / Re: MineFlat (Terraria Port) on: 2013-07-28 16:02:34

when i fall off the map and hit the bottom  pressing the 'space'-Key will just close the game Smiley

There is also a graphical glitch in the middle (horizontal line) of the screen.

So far so good i guess Smiley
24  Game Development / Shared Code / Re: FixtureSprite: easily draw Sprites on Box2D Fixtures / Bodies on: 2013-07-24 23:55:38
Oh my, thank you Smiley Sorry for wasting your time ^^ It's late it guess .>

Everything works perfectly now. Thanks for sharing!

Kind regards,
25  Game Development / Shared Code / Re: FixtureSprite: easily draw Sprites on Box2D Fixtures / Bodies on: 2013-07-24 22:34:22

I'm trying to get your code to work but was unable to.

First off: I had to change your draw method in your because world.getBodies(tmpBodies) wouldn't work (The method getBodies() in the type World is not applicable for the arguments (Array<Body>))

I replaced it with the following code:
public static void draw(SpriteBatch batch, World world) {
    Iterator<Body> wIt = world.getBodies();
        while(wIt.hasNext()) {
            Body body =;
            for(Fixture fixture : body.getFixtureList())
                if(fixture.getUserData() instanceof FixtureSprite)
                    ((FixtureSprite) fixture.getUserData()).draw(batch, fixture);

After this i created a SpriteFixture with a 64x64px Texture and added it to my circleBody (Radius 15F)

and tried both render methods without success.

Do you have an simple example for us?

Kind regards,

Pages: [1]
DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (75 views)
2018-04-24 18:15:36

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (622 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!