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
1  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-29 07:46:56
Thanks for the help, everyone! I managed to find the problem. I needed to use createCompatibleImage() to convert my images to the required format.

Here is my new Texture class:
http://pastebin.com/9S8QMXby
2  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 19:48:11
When turning off the drawing of the level, it significantly improves the FPS, and the listener responds quickly. Here is the Level class and its draw function.

http://pastebin.com/TmuFW3te
3  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 19:41:10
The FPS is capped at 8. If I set it to update slower, it will. But higher than 8 will just result in 8.
4  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 16:23:10
I tried what you said, but nothing changed.

http://pastebin.com/33reqdRy
5  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 13:24:57
Okay, so to test the FPS of my game, I loaded Fraps up to see the counter. The game counts up from 0 to eight frames per second, then stops there. I have no idea why.
6  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 13:19:32
http://pastebin.com/mdEDW6Tx

Here's what fills my ArrayList
http://pastebin.com/AZLKQV63
7  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 03:29:00
I tried having the key listeners set flags, but it still delays. I had my listeners do println()'s, and the message doesn't delay, but the movement does.
8  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-28 00:56:39
Didn't help at all Sad It worked perfectly in my games made in Slick. Maybe something is wrong with my game loop? What is the purpose of SwingUtilities.invokeLater()?
9  Game Development / Game Mechanics / [SOLVED]Keyboard Input Lag on: 2012-01-27 17:43:08
I'm trying to make a game in Java. I decided to be stubborn, and not use LWJGL or Slick. Everything went fine until input. The keyboard arrow presses are delayed, and I don't know what is causing it.

http://pastebin.com/0LTdKr21

EDIT:
Solved. Needed to convert my images during initialization.
http://pastebin.com/9S8QMXby
10  Game Development / Game Mechanics / Re: [SOLVED] "Fog of War" on: 2011-12-24 13:35:49
Thanks a lot. All of these answers are great.
11  Game Development / Game Mechanics / [SOLVED] "Fog of War" on: 2011-12-24 02:10:44
Is there any way I can have it so I can't see units a certain distance away? I thought of drawing only units that intersect with an oval around my player, but it would look weird when they came into view, as they would just pop up. I also thought of a vignette image I could lay over the canvas, but not sure if that would work.
12  Game Development / Newbie & Debugging Questions / Re: Slick Applet on: 2011-12-20 03:16:36
It works fine when I run it as an application, and I'm pretty sure it said to leave it as an AppGameContainer as Slick will make it an AppletGameContainer.
13  Game Development / Newbie & Debugging Questions / Re: Slick Applet on: 2011-12-20 00:25:53
My apologies Smiley



1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
Mon Dec 19 19:25:29 EST 2011 INFO:Slick Build #274
Mon Dec 19 19:25:29 EST 2011 INFO:Starting display 1024x768
Mon Dec 19 19:25:29 EST 2011 INFO:Controllers not available
Test 1
Mon Dec 19 19:25:29 EST 2011 INFO:Initialising sounds..
Mon Dec 19 19:25:29 EST 2011 INFO:- Sound works
Mon Dec 19 19:25:29 EST 2011 INFO:- 64 OpenAL source available
Mon Dec 19 19:25:29 EST 2011 INFO:- Sounds source generated
Test 2
Mon Dec 19 19:25:30 EST 2011 ERROR:null
java.lang.NullPointerException
   at com.theducecat.pong.Pong.update(Pong.java:96)
   at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:657)
   at org.newdawn.slick.AppletGameContainer$Container.runloop(AppletGameContainer.java:514)
   at org.newdawn.slick.AppletGameContainer$ContainerPanel.start(AppletGameContainer.java:218)
   at org.newdawn.slick.AppletGameContainer$1.run(AppletGameContainer.java:92)
org.newdawn.slick.SlickException: Game.update() failure - check the game code.
   at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:663)
   at org.newdawn.slick.AppletGameContainer$Container.runloop(AppletGameContainer.java:514)
   at org.newdawn.slick.AppletGameContainer$ContainerPanel.start(AppletGameContainer.java:218)
   at org.newdawn.slick.AppletGameContainer$1.run(AppletGameContainer.java:92)
14  Game Development / Newbie & Debugging Questions / Slick Applet on: 2011-12-19 22:01:33
I'm trying to make my Slick game an applet, but it keeps giving me an error whenever I have a line like this:

1  
if (app.getInput().isKeyDown(Input.KEY_W)) {
15  Game Development / Game Mechanics / Better Pong Physics on: 2011-12-18 19:59:07
Hey, I just made a quick Pong clone. I want to know how to get better physics from it, since right now, it just reverses the velocities on collision. Here is the download: http://www.mediafire.com/?ete2r0xnw4ed2sc
16  Game Development / Newbie & Debugging Questions / List to ArrayList? on: 2011-12-17 16:42:30
What is the point in having something like this:
1  
List<String> listName = new ArrayList<String>();

I believe this is polymorphism, but what advantage does that give you?
17  Java Game APIs & Engines / Java 2D / Collision Question on: 2011-12-07 02:48:32
I have a player sprite that must collide with blocks in the world. However, I don't want to use a for loop to check every single block in the world every tick, so what can I do? My idea was to get the player's current position, and only check blocks around the player. Is this a good idea?
18  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-12-07 02:44:40
I'm going to be honest, I don't like JavaScript, it isn't my type of language, but I'm forced to use it. I love how easy it is to set up a small script of 10-20 lines of code, but I really hate writing big applications with it. I really hope Google's Dart(http://dartr.com/) takes off. They made some very valid points in their explanation for creating the language. I got a chance to play around with it, and I much prefer the syntax. Right now, it compiles right into JS, but Google wants to strive for this language on browsers, as well as the server.
19  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-04 19:13:41
Cheesy Thanks so much! This works perfectly! For some reason I have to add +1 on to the end of the y, but it still works!
20  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-04 11:24:44
I think using Math.floor helped, but it still has the problem. Here is my entire code.

x and y are the mouse co-ordinates.

camera.getLocation() returns a 2D vector with the x and y offset of the camera (distance from 0, 0).

blockX and blockY are which block is to be deleted.

http://pastebin.com/TRaUXDbg
21  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-04 06:48:45
I can not figure out this problem. I've hit a wall, I don't know what to do.
22  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-03 06:03:11
I can't figure anything out from this data.
23  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-03 05:14:50
gameScale is the scale of everything. It works the same with it on or off.
24  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-03 04:44:20
Nope. Doesn't work, still.  Sad
25  Discussions / General Discussions / Re: Username change? on: 2011-12-03 02:24:52
Well, there is no real reason. I just prefer another one better. If it requires a good reason, I don't have one.  Tongue
26  Java Game APIs & Engines / Java 2D / Re: 2D Block Problems on: 2011-12-03 02:23:29
1  
2  
int blockX = x / (int) gameScale / 16 + (int) (camera.getLocation().x / 16f);
int blockY = y / (int) gameScale / 16 + 1 + (int) (camera.getLocation().y / 16f);


I tried rounding the camera / 16 values, but it doesn't help much.
27  Java Game APIs & Engines / Java 2D / [SOLVED] 2D Block Problems on: 2011-12-03 02:14:02
I have two problems with the game I'm making. I have a 2D block sandbox game, like Terraria. When I move the camera around, I can still click the blocks to break them, but the blocks are sometimes off when I click. For example, when clicking on one block, it will destroy the one next to it. I believe this had to do with the camera's position being a float, and the positioning being thrown off by this. How can I fix it?
28  Discussions / General Discussions / Username change? on: 2011-11-29 03:43:47
Can an admin change my username/display name?
29  Game Development / Newbie & Debugging Questions / Re: Getting Clicked Block on: 2011-11-29 03:38:21
Wow, so simple, but great! Thanks so much!
30  Game Development / Newbie & Debugging Questions / Getting Clicked Block on: 2011-11-29 03:22:52
I'm making a game like Terraria, 2D sandbox. I'm stuck, I can't figure out how to find out what block a user hit. I have the mouse x and y, but the only way I can think of is to have a Rectangle for each block, then use a for loop to cycle through every block to see which rec contains the co-ordinates, but it seems so inefficient.
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.

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

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

TehJavaDev (73 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 (44 views)
2014-09-07 01:13:42

Longarmx (27 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!