Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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
1  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Box2DMapObjectParser camera speed on: 2014-04-23 16:35:58
1  
camera.position.set(0 / PPM, player.getVelocity().y / PPM, 0);

I guess you meant this:
1  
camera.position.set(0 / PPM, player.getY() / PPM, 0);


EDIT: Oh, you just solved it seconds before my reply.
2  Game Development / Newbie & Debugging Questions / Re: GLSL - add effect to all screen instead to a specific texture on: 2014-01-22 16:42:02
I made a video about that:
<a href="http://www.youtube.com/v/caQZKeAYgD8?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/caQZKeAYgD8?version=3&amp;hl=en_US&amp;start=</a>
Here are its vertex and fragment shaders.
3  Game Development / Newbie & Debugging Questions / Re: Noob thinking about trying to use a library on: 2014-01-14 16:46:27
from this topic:
4  Game Development / Newbie & Debugging Questions / Re: count up to 16 with one digit on: 2014-01-13 19:35:07
toAlienNumber -> Integer#toHexString(int)
fromAlienNumber -> Integer#decode(String)
EDIT: Dxu1994 was faster and more exact.
5  Game Development / Newbie & Debugging Questions / Re: Noob thinking about trying to use a library on: 2014-01-13 19:27:04
- What is the best (I hope I dont start a flame war with this) java engine/library for 2D games?
IMHO definitely LibGDX

- Is that engine/library capable of loading/unloading regions of an infinite grid?
Hard to answer, but something like this is definitely possible (e.g. using tile maps (tut))

- Has that engine/library anything to make lights?
Box2DLights works nicely with LibGDX (I recommend to use Box2D anyway)

- Is the engine/library easy to learn for a noob?
I was a noob when I learned it and I still love it, so I guess yes.

- Does that engine/library provides an easily accessible particle/sprite system?
Yes, it even provides a Particle Editor

In addtion, I made libgdx-utils and some tutorials.
6  Discussions / Miscellaneous Topics / Re: javadoc tool doesn't document all overloaded methods on: 2013-12-21 20:25:26
That's what I thought as well. Made sure my settings are correct now, should work in the future.

is there any way you can see what parameters Eclipse runs the Javadoc tool with?
Yes, there's even an option to export the settings to an ANT script. I used the exact same flags but no difference.
The ANT script uses slightly different names for the flags though, maybe I interpreted some incorrectly.
7  Discussions / Miscellaneous Topics / Re: javadoc tool doesn't document all overloaded methods on: 2013-12-21 19:01:23
I'm sorry, I thought JGO would send me an email if someone replied. Apparently it didn't... Anyway, thanks for your reply Smiley
Why not just use Eclipse's export instead of command line if that's what works?
Well I don't use it on the command line manually, it's part of a script that packs the compiled classes, sources and javadoc in jars and a zip.
maybe there is  a place to edit the arguments in Eclipse's options.
Yes, there's even an option to export the settings to an ANT script. I used the exact same flags but no difference.
Didn't find any help in the documentation as well :/

I hope your exam went well Smiley
8  Games Center / Featured Games / Re: Oh My Goat avalaible for iOS, Android and Ouya! on: 2013-12-08 22:07:13
I was waiting for this release, it's absolutely great! I love the pace and art of this game. Looking forward to more levels! Cheesy
9  Discussions / Miscellaneous Topics / javadoc tool doesn't document all overloaded methods on: 2013-12-08 21:07:03
Hey guys,
I use the javadoc tool on the command line. It works fine but there's a little difference between using it on the command line and in eclipse.

Consider this piece of code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
   /** documentation */
   public Rope split(Joint joint) {
      // ...
  }

   /** documentation */
   public Rope split(int jointIndex) {
      // ...
  }


Using eclipse to export the documentation, I can see both methods in it.
However, if I use the javadoc command myself, I only see the first one which in this case is split(Joint).

Even weirder, in the same document and same class, I can see both of these methods using the command line:
1  
2  
3  
4  
5  
6  
7  
8  
9  
   /** documentation */
   public Rope build(int length) {
      // ...
  }

   /** documentation */
   public Rope build(int length, Builder builder) {
      // ...
  }


Eclipse uses the same executable so I guess I'm missing some parameters or something...

Thanks for any ideas!
10  Game Development / Newbie & Debugging Questions / Re: LibGDX + TileMap, Problem with collision, tile properties and dimension on: 2013-11-30 16:23:25
Andre: I am not using stages in my game. Should i?
This has nothing to do with your issue. There's no need for a Stage for what you want to do.

And you did set your mapRenderer.setView() to camera.combined, too? Cheesy
The setView method takes an OrthographicCamera, not a Matrix4. It uses the combined matrix of the given camera already.

Sabomoth: You are using two SpriteBatches (batch and the one in the map renderer). A SpriteBatch is a heavy object, so you should always just have one at a time. Also, it makes it more complicated to keep track of their matrices, like you are experiencing. In the code you posted in reply #6, you used the other SpriteBatch that didn't have the combined matrix set. That's why seismic's suggestion in reply #7 fixed at least part of the problem. I suggest you to get rid of batch and use only the one from the map renderer. It's projection matrix gets set by the setView(..) method already. Also, update before you render to avoid a lag of one frame.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public void render(float delta) {
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
     
      player.update();
      camera.position.set(player.position.x + player.getWidth() / 2, player.position.y + player.getHeight() / 2, 0);
      camera.update();

      mapRender.setView(camera);
      mapRender.render();
      mapRender.getSpriteBatch().begin();
      mapRenderer.getSpriteBatch().draw(player.getTexture(), player.position.x, player.position.y);
      mapRender.getSpriteBatch().end();
   }


Maybe your collision isn't working properly because you don't set increment before checking for the collision on the X axis:
1  
2  
3  
4  
5  
// Move in X.
     position.x = (position.x + velocity.x * Gdx.graphics.getDeltaTime() * SPEED);
     
      // Check collision in X.
     // ...

It should be more along those lines:
1  
2  
3  
4  
5  
6  
7  
8  
      // Move in X.
     position.x = (position.x + velocity.x * Gdx.graphics.getDeltaTime() * SPEED);
     
      // calculate the increment for step in #collidesLeft() and #collidesRight()
     increment = collisionLayer.getTileWidth();
      increment = getWidth() < increment ? getWidth() / 2 : increment / 2;
     
      // Check collision in X.


Also make sure you use the correct coordinates in the collidesLeft, Right, Top and Bottom methods.
11  Games Center / Showcase / Re: Blitz on: 2013-11-24 21:21:58
So what about those linux natives? I would like to try this game.
12  Game Development / Newbie & Debugging Questions / Re: Tiled Platformer with Slopes - Libgdx Tiled+Box2D on: 2013-10-08 06:51:26
If you're already using Box2D, why not for the collisions as well?
13  Game Development / Shared Code / Re: Box2DMapObjectParser: edit Box2D with your map editor on: 2013-10-07 16:53:08
Tiles have nothing to do with Box2D bodies. Also, tiles cannot move around freely. To draw images on bodies, you can use the Box2DSprite (thread) or do it manually.
14  Games Center / Android Showcase / Re: [Ouya] XY Cannon on: 2013-09-24 22:08:40
Trying this out right away! Very nice Geometry Wars-like graphics!
EDIT: Tried it now and I'll definitely keep this on my phone. It's not too easy and the game idea is also pretty nice.
15  Java Game APIs & Engines / Engines, Libraries and Tools / Re: libGDX/Box2D on: 2013-09-16 22:12:52
Have a closer look at this part.
1  
2  
3  
Sprite s = new Sprite(ball);
Box2DSprite box2DSprite = new Box2DSprite(s);
ballBody.setUserData(s);

I think you'd like to actually put the Box2DSprite in the bodies user data instead of the Sprite it was created with Smiley
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: libGDX/Box2D on: 2013-09-16 19:08:14
I could help to find the mistake in the implementation if you posted it. However, I'm not trying to force the Box2DSprite on you Smiley Use what you think makes the most sense for you now.

In the first link I posted previously, basically this happens:
  • set the size of the Sprite to the size of the body (in meters, no conversion)
  • put the sprite in the bodies user data
  • get all bodies and their user data, if it's a Sprite:
        
    • set its position to the bottom left corner because it'll be drawn from there (body position (is center) - sprite width / 2)
    • set its rotation to the body rotation (body.getAngle() * MathUtils.radiansToDegrees), need to convert from radians to degrees here because the method takes degrees
    • draw it
17  Game Development / Shared Code / Re: Box2DMapObjectParser: edit Box2D with your map editor on: 2013-09-16 18:54:10
You now have the choice to triangulate or decompose into convex polygons. I'd have done it from the start, but didn't know any good resource (also I didn't search much since LibGDX's triangulator worked fine, so I was happy). Decomposing into convex polygons is way cooler of course, so that's what it does by default (change with setTriangulate(boolean)). Thanks for this!
I updated the downloads.
18  Game Development / Newbie & Debugging Questions / Re: [Slick] Text Field Input on: 2013-09-16 17:40:23
When I was a newbie and worked with Slick, I made these few UI elements.
This is not really a good example. It's not good object oriented design and has invalid javadocs.
Just sharing it because you could probably learn something from it. Try to do it better though.
19  Java Game APIs & Engines / Engines, Libraries and Tools / Re: libGDX/Box2D on: 2013-09-16 16:15:21
What was the problem with the Box2DSprite?
Here is some example code without it coming from this (the null check in line 60 is not necessary, btw).
20  Game Development / Shared Code / Re: Box2DSprite: easily draw Sprites on Box2D Bodies and Fixtures on: 2013-09-14 01:12:22
Oh great, the organization and java knowledge will come over time Smiley It's basically just OO design.
Really? I actually wasn't, it was just pretty new to me so I just had to concentrate very much Grin
21  Games Center / Featured Games / Re: Attack of the Gelatinous Blob on: 2013-09-13 00:13:15
Really nice! Reminds me of this movie that I watched a while back.
22  Game Development / Shared Code / Re: Box2DSprite: easily draw Sprites on Box2D Bodies and Fixtures on: 2013-09-13 00:03:35
Glad it helps you Smiley The library also contains other classes that might be useful for you, like the AnimatedSprite (there's a Box2D version as well).

will I have to change the package declerations all the time or is there some sort of method to do this automatically

Just don't copy and paste the source in your game Wink

download a jar there and put it in your project like you're used to from other libraries.
This means:
- download this
- move it into the folder called "libs" in your core project
- right-click the project and go to Properties -> Java Build Path -> Libraries
- click "Add JARs..."
- select libgdx-utils.jar from the libs folder

- optional: if you'd like to be able to click the class names with ctrl + click to see the source: download this, click the arrow left to libgdx-utils.jar (which is now in the list), double click "Source attachement" and select libgdx-utils-sources.jar (which you also have to put into your project)

- click ok and ok again, done

Since you're starting out with LibGDX, I'm also using this post to shamelessly point you to my tutorials Grin
23  Game Development / Shared Code / Re: Box2DSprite: easily draw Sprites on Box2D Bodies and Fixtures on: 2013-09-12 23:38:47
Sorry, the links were a bit outdated.
This is now included in my mini library which grew a bit so it's in its own repository now. You can download a jar there and put it in your project like you're used to from other libraries.
24  Game Development / Game Mechanics / Re: Check if a line is entirely inside a polygon on: 2013-09-08 18:00:52
Thanks guys, it's working!
The path finding method you described involves something called a navigation mesh and may be called region based pathfinding.
Yes, I tried my own navigation mesh pathfinding algorithm. It was crap though Wink
25  Game Development / Newbie & Debugging Questions / Re: libGdx HUD/ UI + PathFinding on: 2013-09-07 12:33:52
Here's a little test I wrote for the Slider. The relevant part of my skin file:
1  
2  
3  
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
   default-horizontal: { background: default.background, knobBefore: default.selection }
}

It worked all fine for me, so I guess there is no bug.

You could create  a boolean or float array, depending on the type of your algorithm (with weighting or not) of the size of the tile map.
For example:
1  
2  
3  
4  
5  
6  
TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayer("pathfinding");
float width = map.getProperties().get("width"), height = map.getProperties().get("height");
float[][] pathfindingMap = new float[width][height];
for(int x = 0; x < pathfindingMap.length; x++)
    for(int y = 0; y < pathfindingMap[x].length; y++)
        pathfindingMap[x][y] = layer.getCell(x, y).getTile().getProperties().get("weight", Float.class);

Then do the pathfinding using the pathfindingMap. Didn't test though.
26  Games Center / Showcase / Re: F.T.W on: 2013-09-07 11:51:31
Nice little game! I'm bad with the mouse, couldn't get over 17 Clueless Btw, if the yellow rectangle spawns in the red death counter (or probably the other numbers as well), you can't collect it.
27  Game Development / Newbie & Debugging Questions / Re: Going through a set number of methods in a random order without repeating any on: 2013-09-06 16:48:35
If you look at the code, it gets increasingly slower the further you get into calling next().
You're right. I'll tell the author. Probably I shouldn't throw around pieces of code that are just said to be fast as well.
28  Game Development / Newbie & Debugging Questions / Re: Going through a set number of methods in a random order without repeating any on: 2013-09-06 15:51:38
Quote
That doesn't look efficient at all. Collections.shuffle() runs in linear time while the one you suggested looks, to me, to run at BEST in linear time.
Well I can't tell but it's said to be tested with 8000 elements and finished in 2.5 ms.
29  Game Development / Newbie & Debugging Questions / Re: Going through a set number of methods in a random order without repeating any on: 2013-09-06 15:11:20
I'm not sure how fitting this is, but this iterates in a random order and is ridiculously fast even with 8000 elements (2.5 ms). I'm not the author.
30  Games Center / WIP games, tools & toy projects / Re: Viking Supermarket Smash! on: 2013-09-06 15:02:43
This game looks super funny! The download link is broken though...
Pages: [1] 2 3
 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (74 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (45 views)
2014-09-07 01:13:42

Longarmx (28 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!