Java-Gaming.org Hi !
 Featured games (83) games approved by the League of Dukes Games in Showcase (539) Games in Android Showcase (132) games submitted by our members Games in WIP (603) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 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.xp.y -= c.ynewx = p.x * cos(angle) - p.y * sin(angle)newy = p.x * sin(angle) + p.y * cos(angle)p.x = newx + c.xp.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
 6 Games Center / WIP games, tools & toy projects / Re: Gravity Spy (LD27) on: 2013-08-26 14:57:06 Quote from: Herjan on 2013-08-26 14:31:53Your 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.Quote from: Herjan on 2013-08-26 14:31:53Your game would be much better if you made the lights flicker/give signal before they switch, now you can't see it coming :SSomeone 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 Game only uses 2 tiles, pretty cool huh?Ludum Dare page: http://goo.gl/PbSx64Jar: http://goo.gl/0zjX4LSource code: http://goo.gl/xPwuXe
 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: http://www.java-gaming.org/topics/2d-dynamic-lighting/27012/view.html
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)
 1  2  3  4  5  6  7  8  9  10  11  12  13  14 `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 I assume you're using applyLinearImpulse to move the melon, I'd change that to applyForce (except for jumping) to make controls smoother.
 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:
 1  2  3  4  5  6  7 `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; //speedcamera.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: http://www.badlogicgames.com/wordpress/?p=2870 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.Download: https://dl.dropboxusercontent.com/u/31393301/LD26/threetiles_win.exeSource: https://dl.dropboxusercontent.com/u/31393301/LD26/ThreeTiles_src.zipLD page: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=10029
 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
Hello!
Quick question! I have player input setup like this:
 1  2  3  4  5 `boolean keyUp = Keyboard.isKeyDown(Keyboard.KEY_UP)...if(keyUp){    //move code}`

And a bit later:
 1  2  3  4  5 `while(Mouse.next()){   if(Mouse.isButtonDown(0)){      //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 Quote from: HeroesGraveDev on 2013-01-06 22:05:57I 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!  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
 Add your game by posting it in the WIP section, or publish it in Showcase. The first screenshot will be displayed as a thumbnail.
 rwatson462 (30 views) 2014-12-15 09:26:44 Mr.CodeIt (20 views) 2014-12-14 19:50:38 BurntPizza (42 views) 2014-12-09 22:41:13 BurntPizza (76 views) 2014-12-08 04:46:31 JscottyBieshaar (37 views) 2014-12-05 12:39:02 SHC (51 views) 2014-12-03 16:27:13 CopyableCougar4 (49 views) 2014-11-29 21:32:03 toopeicgaming1999 (115 views) 2014-11-26 15:22:04 toopeicgaming1999 (105 views) 2014-11-26 15:20:36 toopeicgaming1999 (31 views) 2014-11-26 15:20:08
 LiquidNitrogen 35x basil_ 31x Rayvolution 31x HeroesGraveDev 27x BurntPizza 18x kevglass 17x appel 17x Gibbo3771 15x kpars 15x gouessej 14x princec 13x Riven 12x SHC 10x Ecumene 10x pitbuller 9x KevinWorkman 9x
 Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27Resources for WIP games2014-08-01 16:20:17Resources for WIP games2014-08-01 16:19:50List of Learning Resources2014-07-31 16:29:50
 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