Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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
1  Game Development / Newbie & Debugging Questions / Re: Rotating a point around a center point algorithm on: 2013-10-22 20:51:11
Or like this:
To rotate a point 'p' around another point/origin 'c' simply subtract c from p, then rotate p and add c.

p.x -= c.x
p.y -= c.y

newx = p.x * cos(angle) - p.y * sin(angle)
newy = p.x * sin(angle) + p.y * cos(angle)

p.x = newx + c.x
p.y = newy + c.y
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: libGDX/Box2D on: 2013-09-16 15:41:05
I do it so that in my entity class (player for example) I have box2d's body field which gets added to world at the begining. Then in entitiy's render method you can draw anything at body.getPosition().
3  Games Center / WIP games, tools & toy projects / Re: Gravity Spy (LD27) on: 2013-08-28 10:52:26
It's part of the game yes. Sometimes you need to go into lower orbit to complete a level.
4  Game Development / Newbie & Debugging Questions / Re: Orbit ? on: 2013-08-27 21:16:36
Just make a "planet" class where you have vector for position and velocity. In update method you can iterate through other planets, calculate angle to this one and apply some speed into that direction (of course you have to keep in mind that a=m/s^2). You could also work with mass for more realistic simulations. For user's control you'd just apply some custom speed to any planet.
5  Games Center / WIP games, tools & toy projects / Re: Gravity Spy (LD27) on: 2013-08-27 11:08:22
I think you're in orbit  Grin
6  Games Center / WIP games, tools & toy projects / Re: Gravity Spy (LD27) on: 2013-08-26 14:57:06
Your own music! Cool, what tool did you use for that?
FL Studio. I was making music before I started programming, but never got really into it.

Your game would be much better if you made the lights flicker/give signal before they switch, now you can't see it coming :S
Someone on the LD page suggested this aswell and yeah it would be cool. I didn't thought of that before and some other minor tweaks.
7  Game Development / Newbie & Debugging Questions / Re: Simple Day/Night Cycle Libgdx on: 2013-08-26 10:56:57
I normally keep a float in level class for time [0, 1]. 0 would be night and 1 is day. Then I calculate the current value with a sine curve (There's probably different ways).
After that you can use this value to position the sun sprite and stuff like that. If you're using LibGDX you can use it with sprite batch as a tint color, which would make nights dark and days bright.
8  Games Center / WIP games, tools & toy projects / Gravity Spy (LD27) on: 2013-08-26 01:46:32
Phew. That was intense. Here's my LD27 entry!
I went for that stealth type game, which was not my first idea but it was an option to do something with "10 seconds" and got opportunity to play around with box2D.
Also I've made my own music for the first time Smiley
Game only uses 2 tiles, pretty cool huh?

Ludum Dare page:
Source code:
9  Games Center / Contests / Re: Ludum Dare 27 on: 2013-08-22 07:29:46
Totally doing this. I hope the theme will be something interesting.
10  Game Development / Newbie & Debugging Questions / Re: lighting system on: 2013-08-21 19:16:44
Take a look over here:
11  Game Development / Newbie & Debugging Questions / Re: Tiles on: 2013-08-18 13:03:09
I always keep tiles in 1D array and draw them either with 2 for loops (accessing tileID with tiles[x+y*mapWidth]) or something like this:
(rough example)
int mapWidth = 2;
int mapHeight = 2;
int[] tiles = {
   1, 1
   1, 2

for(int i = 0; i < tiles.length; i++) {
   int x = i % mapWidth;
   int y = i / mapWidth;
   int tileID = tiles[i];
   draw(tileID, x, y);
12  Game Development / Newbie & Debugging Questions / Re: Tower Defence waves loading on: 2013-08-13 18:38:22
How about randomized spawns? Make a spawner helper class with variables like: enemy types, spawn delay, max enemies spawned etc. Logic behind that is self-explanatory and those values can vary over time and/or wave.
13  Games Center / WIP games, tools & toy projects / Re: Mega Melon Adventure on: 2013-08-06 13:35:57
Looks lovely Smiley I assume you're using applyLinearImpulse to move the melon, I'd change that to applyForce (except for jumping) to make controls smoother.
14  Games Center / WIP games, tools & toy projects / Knights & Arrows (7DRTS) on: 2013-07-30 01:20:07
An RTS style game made for MiniLD#44. Manage squads, protect your base and destroy enemies.

"A" - Select/deselect all squads.
"LCTRL" - Invert selection.
Drag to select squads.
Hold LSHIFT while selecting to add squads to selection.
Click anywhere to open Move/Attack/Abort menu.

Each squad can contain 9 units and you can have 10 squads max.
There are 4 different unit classes:
-Bowman and magician: long ranged, lower hp.
-Monk: mid ranged, less damage, can heal other units of the same squad.
-Knight: short ranged, fast and high damage attacks.

JAR Download:
LD Page:
15  Java Game APIs & Engines / Engines, Libraries and Tools / [LibGDX]TiledMap screen tearing on: 2013-07-19 07:25:35
I found a few similar topics on this problem, but I failed to solve it. When rendering a tiled map using API from libgdx or slick2D there are awful white lines across the screen (if camera moves). I tried constraining camera position to integer values, which works but not for scaling. Pre-rendering to FBO gets rid of some artifacts but map still isn't smooth. Any ideas?
16  Game Development / Newbie & Debugging Questions / Re: Entity[] not working? on: 2013-07-13 16:34:25
To initialize an object means to do this: object = new Object()... tree = new ConstructionTree() in your case. "Object object;" is just declaring an object field.
17  Game Development / Newbie & Debugging Questions / Re: Entity[] not working? on: 2013-07-13 16:26:02
Did you initialize "tree" object?
18  Game Development / Newbie & Debugging Questions / Re: OpenGL VBO rendering vs Immediate Mode on: 2013-07-11 20:54:59
Try not to use immediate mode. If you need to update vertex data every frame look into vertex arrays. VBOs are usually used for mostly static geometry that doesn't change so often.
19  Game Development / Newbie & Debugging Questions / Re: Render methods on: 2013-07-09 14:52:25
Use the code in first paragraph, because that's how you use double buffering (triple in your case). It draws an offscreen image and then draws that image to screen, without drawing other stuff separately, which removes flickering in java2D games.
20  Game Development / Newbie & Debugging Questions / Re: LWJGL camera zooming? on: 2013-07-08 16:39:16
Mouse.getDWheel() should return negative, 0 or positive number. So just change that to -1, 0 or 1 using IF's.
21  Game Development / Newbie & Debugging Questions / Re: LWJGL camera zooming? on: 2013-07-08 16:07:59
Simple linear interpolation should do the trick:
int wheel = Mouse.getDWheel();
if (wheel != 0) {
   targetZoom += 0.05f * wheel;
   targetZoom = clamp(targetZoom, 0.0125f, 1f); //clamp(x,min,max)
float t = 0.02f; //speed
camera.setZoom(camera.getZoom() + t * (targetZoom - camera.getZoom()));
22  Discussions / General Discussions / Re: Whatever happened to Euclideon's Unlimited detail? look inside to see! on: 2013-07-05 11:24:50
I hate how he keeps saying "unlimited data", which is simply impossible and silly to even mention. However, I'd like to try out a demo.
23  Game Development / Newbie & Debugging Questions / Re: How to use Tiled with Libgdx on: 2013-06-27 03:34:08
The second link you posted is the right tutorial, but libGDX 0.9.8 doesn't contain some of the classes. I don't know what is going on there, but check this out: On this post you can find github link and download the project, which contains those classes. I had to unzip the original library and add classes from com.badlogic.gdx.maps.tiled.* to get it to work. Kind of messy, but it works.
24  Games Center / Showcase / Re: Three Tiles on: 2013-04-29 15:31:35
Thanks for your comments. I fixed some bugs and added new levels today. (url is updated)
25  Games Center / Showcase / Three Tiles on: 2013-04-29 01:28:20
Hey all!
Just want to show a game I made for ludum dare. It was an awesome experience and the longest coding streak I ever did.

LD page:
26  Game Development / Newbie & Debugging Questions / Re: LWJGL Keyboard, what's going on? on: 2013-01-28 17:30:34
So I could just use the keys I need.
27  Game Development / Newbie & Debugging Questions / Re: LWJGL Keyboard, what's going on? on: 2013-01-28 17:25:53
Ah I see. Gonna implement it straight away. Thanks!
28  Game Development / Newbie & Debugging Questions / LWJGL Keyboard, what's going on? on: 2013-01-28 16:22:36
Quick question! I have player input setup like this:
boolean keyUp = Keyboard.isKeyDown(Keyboard.KEY_UP)
    //move code

And a bit later:
      //fire button (boom boom)

So what happens is, if player holds UP key to run and presses mouse button to fire, movement stops. In order to run again, player must press up key again, running while shooting is impossible.
Why do keys get reset that way?
29  Games Center / Cube World Projects / Re: Merging triangle faces! on: 2013-01-06 22:24:26
I don't see why you need to optimise it that much. And that will just slow down the CPU when just one block is missing from the surface.
Well it seems like a good way to increase performance, I'll stick to only face and frustrum culling for now.
30  Games Center / Cube World Projects / Merging triangle faces! on: 2013-01-06 21:56:13
Hello!  Smiley
I need some help!
So basically, having an integer array of cube ids with the size of 16^3 and static method, which returns triangle vertices based on location given by array iterator. Feeding vbo with that data I get this mess:

Nothing fancy but here's a problem I'm struggling with..
That chunk of cubes could also be rendered like this, providing that ids are the same:

Getting rid of cubes that are completely surrounded would be easy, but I still have a lot of verticies left that don't have to be stored in memory. I need someone's help on algorithm that would "merge" verticies that share the same properties and kept triangle topology. (after trying it just got far too complex)
Pages: [1] 2
Riven (24 views)
2015-07-27 16:38:00

Riven (14 views)
2015-07-27 15:35:20

Riven (19 views)
2015-07-27 12:26:13

Riven (9 views)
2015-07-27 12:23:39

BurntPizza (24 views)
2015-07-25 00:14:37

BurntPizza (36 views)
2015-07-24 22:06:39

BurntPizza (20 views)
2015-07-24 06:06:53

NoxInc (23 views)
2015-07-22 22:16:53

NoxInc (15 views)
2015-07-22 22:13:39

Jesse (36 views)
2015-07-22 03:10:36
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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!