Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
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  Java Game APIs & Engines / Java 2D / Re: Problem with game loop on: 2012-10-14 08:17:42
I'm just trying to implement some code so that I get constant slowed movement in a snake game. The way I imagine to achieve this would be to do:
1  
2  
3  
4  
5  
6  
7  
8  
long initialTime = System.currentTimeMillis();
while (running) {
    if (System.currentTimeMillis() - initialTime >= 1000) {
        render();
        update();
        initialTime = System.currentTimeMillis();
    }
}


However I still get the super laggy window problem.
2  Java Game APIs & Engines / Java 2D / Problem with game loop on: 2012-10-10 05:51:40
I'm trying to replicate my code from in Python with Java to make a snake game. Upon setting up the basics of the game, a helpful person from IRC found me a thread which ra4king posted in that gave the exact details of a perfect game loop.

This is, however, where my problem started. I implemented all the code and then ran it. Immediately I noticed the window lagging and taking some time to move it around or actually do anything and the FPS that was being printed was 6000-8000, strange? This loop is here, http://www.java-gaming.org/topics/about-on-my-main-loop/26222/msg/229028/view.html#msg229028

My code is in the following - https://dl.dropbox.com/u/102063272/Snake.zip

Note: I am running this in Ubuntu, but when Xardov ran it on Windows 7 it runs perfectly fine at 800-1600 FPS.
3  Games Center / 4K Game Competition - 2012 / Re: Electron Golf 4k on: 2012-02-01 05:42:22
Any word on whether it works now or not?

I can confirm that it now works.

~Shazer2 Smiley
4  Discussions / General Discussions / Re: Go on, ask me anything. on: 2012-01-30 11:07:45
More suggestions please. You give good suggestions, but I don't like them two. They are different to the usuals I get told though.

~Shazer2 Smiley
5  Discussions / General Discussions / Re: Go on, ask me anything. on: 2012-01-30 08:24:37
Does not really matter if you start out with Python, JS or Basic.
It teaches you to think in programming terms. Learing other languages later is normally a natural process.
-> plus, knowing more than 1 language concept makes you think more out of the box.

I know but Java is where I wanted to branch from. I don't know what game to make.  Huh

~Shazer2 Smiley
6  Discussions / General Discussions / Re: Go on, ask me anything. on: 2012-01-30 07:49:45
What is the secret to game development success? Whenever I attempt to create a game I find myself failing in every way possible. I can say I have learned one thing along the way though, high aspiration leads to false hope and failure.

I'm attempting to re-create Breakout at the moment, but I just can't get the collision/velocity working right when I hit a block, and god damn it's annoying me.

~Shazer2 Smiley
You simply have to persist for about 10,000 hours or so before you get any good at it at all. Yes, 10,000 hours. That's several years of totally dedicated game writing.

Cas Smiley

I have lots of work ahead of me. I hope I can succeed. I just started Year 11 at school and doing Software Design and Development, hope that helps a bit. Unfortunately most of the work is ActionScript and Python.

~Shazer2 Smiley
7  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-29 03:59:18
It is what I was told in #lwjgl by sproingie.

~Shazer2 Smiley
8  Game Development / Game Mechanics / Re: Keyboard Input Lag on: 2012-01-29 02:45:23
Do this for the loop too, instead of doing blocks.get(i) everytime.
1  
2  
3  
for (Block block : blocks) {

}


That way you can access it by doing
1  
2  
3  
switch(block.get(j)) {

}


Just a bit of a cleaner way.

~Shazer2 Smiley
9  Games Center / 4K Game Competition - 2012 / Re: The Little Scientist 4K on: 2012-01-29 01:40:35
I think my record is around 170s. I'll re-do it and screenshot it.

~Shazer2 Smiley
10  Games Center / 4K Game Competition - 2012 / Re: Electron Golf 4k on: 2012-01-29 01:39:00
Spacebar and WASD aren't working for me either.

~Shazer2 Smiley
11  Discussions / General Discussions / Re: Go on, ask me anything. on: 2012-01-29 01:11:00
What is the secret to game development success? Whenever I attempt to create a game I find myself failing in every way possible. I can say I have learned one thing along the way though, high aspiration leads to false hope and failure.

I'm attempting to re-create Breakout at the moment, but I just can't get the collision/velocity working right when I hit a block, and god damn it's annoying me.

~Shazer2 Smiley
12  Games Center / 4K Game Competition - 2012 / Re: The Little Scientist 4K on: 2012-01-27 01:54:45
Ah, got it. Smiley


~Shazer2 Smiley
13  Games Center / 4K Game Competition - 2012 / Re: Kobold Tournament 4k on: 2012-01-27 00:56:37
Getting the red ball restores your health to full.

~Shazer2 Smiley
14  Games Center / 4K Game Competition - 2012 / Re: The Little Scientist 4K on: 2012-01-27 00:55:45
I don't know how to finish it. I keep creating space ships, fly to another planet but it just keeps returning to the same planet I've been to before.

~Shazer2 Smiley
15  Discussions / General Discussions / Re: Heya! on: 2012-01-26 22:45:45
Welcome, JGO is a wonderful place to roam. I'm sure you'll love it.

~Shazer2 Smiley
16  Discussions / Miscellaneous Topics / Re: [College: Art Institute of Seattle: Project?/Career Path?] on: 2012-01-26 00:07:25
Most Microsoft (XBox) games are coded in C# with XNA.

~Shazer2 Smiley
17  Games Center / 4K Game Competition - 2012 / Re: Kobold 4k on: 2012-01-24 22:58:50
It looks good, but it feels like the walls don't suit the rest of the game. I also think an optional movement option should be implemented (W,A,S,D). Nice work though.

~Shazer2 Smiley
18  Game Development / Newbie & Debugging Questions / Re: Error reading file on: 2012-01-24 22:28:37
Nevermind me, didn't see that you mentioned the error

~Shazer2 Smiley
19  Games Center / 4K Game Competition - 2012 / Re: New server on: 2012-01-23 20:49:37
Local problem toasten. Works fine for me.

~Shazer2 Smiley
20  Discussions / General Discussions / Re: Noticed something on minecraft.net... on: 2012-01-23 20:01:12
It's alright guys, he changed it. Everyone is going to be safe.

~Shazer2
21  Game Development / Game Play & Game Design / Re: Hathonial on: 2012-01-22 00:01:34
Alternatively you can play http://runescape.com
OMG I'm dying :')

@OP
To be completely honest, the fact that you're 12 is....well....just a tad bit too young to work on something like this. I love the enthusiasm for coding but it is best to start...smaller (WAY smaller).

 Grin

I remember wanting to tackle something like this when I first started.. funnily enough Runescape/JaGeX was my biggest inspiration.
22  Game Development / Game Play & Game Design / Re: Hathonial on: 2012-01-21 23:46:26
Alternatively you can play http://runescape.com
23  Game Development / Newbie & Debugging Questions / Re: Text field. on: 2012-01-21 23:12:54
You can still use a Java font as a parameter in TrueTypeFont if need be. I've done it a few times myself.
1  
2  
font = new TrueTypeFont(new java.awt.Font("Verdana",
            java.awt.Font.PLAIN, 14), true);


Then you would set the font the same as you would any other way.

~Shazer2
24  Game Development / Performance Tuning / Capped framerate and "getting" FPS on: 2012-01-21 12:48:58
I'm trying to learn how to cap my framerate to 60 using JUST Java. I have a simple understanding yet far from perfect or even knowing how to get it working. I just know I need to get the time --> do rendering updates etc --> get the time again. I then need to do something with the difference (lastTime - firstTime) but I'm not sure what.

Any help with game looping and getting/setting the FPS would be much appreciated.

~Shazer2
25  Game Development / Newbie & Debugging Questions / Re: Draw image to a grid based on mouse click on: 2012-01-19 02:18:53
I should have wrote on the thread that I got it sorted. Thanks anyway, StonePickaxes.

~Shazer2
26  Game Development / Newbie & Debugging Questions / Draw image to a grid based on mouse click on: 2012-01-19 01:54:07
What I am wanting to achieve is for my image to be drawn at coordinates divisible by 24 only. Let's say I click at 170, 80 I need to find the closest coords (x AND y) that are divisible by 24 and draw the image there.

I can't think of a suitable method to do this, so if anyone can provide some guidance for me that would be much appreciated.

~Shazer2
27  Game Development / Newbie & Debugging Questions / Re: Copying a 2D array to another one on: 2012-01-19 01:27:47
Look at his getMap method. If level is 1 the map is set to leveltest.
28  Game Development / Newbie & Debugging Questions / Re: Copying a 2D array to another one on: 2012-01-19 01:16:23
leveltest isn't really set. You need to do.
1  
2  
3  
4  
5  
6  
7  
8  
9  
int[][] leveltest = new int[width][height] {
         {1, 1, 1, 1, 1, 1, 1, 1, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 1, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 1, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 1, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 1, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 0, 1,}, //
        {1, 1, 1, 1, 1, 1, 1, 1, 1,} //
  };


You will need to do the same for level1 too.
29  Games Center / 4K Game Competition - 2012 / Re: 4Kanvas - Online Voxelediting on: 2012-01-17 21:20:57
Hey dude, well done. I could only dream of creating something like this.

~Shazer2
30  Discussions / Suggestions / Re: Please don't email my password in plaintext on: 2012-01-16 22:52:38
Update or change to MyBB, much more secure. They are free and provide a merge tool.  Grin
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.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
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!