Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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
Hi,

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: http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/ 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.

1  
2  
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:
1  
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
1  
2  
3  
4  
5  
6  
7  
foreach chunk you are in do:
    for(int x = leftEdgeX - 1; x < rightEdgeX + 1; x++{
        for(int y = bottomEdgeY; y < topEdgeY; y++ {
           tiles[x][y].render();
        }
    }
}


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
Fixed.
Thanks!
4  Game Development / Newbie & Debugging Questions / Re: LibGDX - Collisions using Rectangles inside ArrayLists with Iterator on: 2013-09-19 13:56:08
Hmm.

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
1  
if(asteroid.overlaps(shot)) { iter.remove(); }


A solution would be:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
Iterator<Rectangle> iter = asteroids.iterator();
      while(iter.hasNext()) {
          Rectangle asteroid = iter.next();
          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 = shotIter.next();
              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
1  
2  
3  
4  
5  
6  
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:

[bossID].table
tdIDlnItemIDtdDropChance
012620.01
113370.50

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]
1  
2  
3  
4  
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(Gdx.graphics.getWidth() / 2, Gdx.graphics.setHeight() / 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]
1  
2  
3  
4  
5  
6  
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.begin();
batch.draw(map, 0, 0);  // Draws your map at 0,0 - width expands to the right, height expands up
batch.end();

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 java.net 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 https://bitbucket.org/
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, ....)

Workflow:
[Client]
- User enters username & password
- Username and hashed password are send to the server
[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:

http://opensource.org/licenses/MIT
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.: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/TextureAtlas.html#TextureAtlas(com.badlogic.gdx.files.FileHandle, boolean)
18  Game Development / Newbie & Debugging Questions / Re: LibGDX error : Camera setup on: 2013-08-02 13:22:01
1  
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:
1  
2  
3  
batch.setProjectionMatrix(cam.combined);
batch.begin();
...
?
20  Game Development / Newbie & Debugging Questions / Re: Always Left with TouchDown Click on: 2013-08-01 20:22:55
Hi,

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

1  
2  
3  
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

1  
2  
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:

http://horde.wessles.com

(you can change this however by adding
1  
ServerAlias www.horde.wessles.com
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. horde.wessle.com/horde1-3-2.zip) 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
http://www.puppygames.net/blog/?p=914


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
Hiho,

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,
Drabla
25  Game Development / Shared Code / Re: FixtureSprite: easily draw Sprites on Box2D Fixtures / Bodies on: 2013-07-24 22:34:22
Greetings.

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

First off: I had to change your draw method in your FixtureSprite.java 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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
public static void draw(SpriteBatch batch, World world) {
    Iterator<Body> wIt = world.getBodies();
        while(wIt.hasNext()) {
            Body body = wIt.next();
            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)
1  
circleBody.addUserData(spriteFixture); 

and tried both render methods without success.

Do you have an simple example for us?

Kind regards,

Drabla
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (55 views)
2014-10-14 00:39:48

TehJavaDev (55 views)
2014-10-14 00:35:47

TehJavaDev (44 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!