Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (563)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (605)
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]
1  Game Development / Game Mechanics / Re: The 0,1 & 2 conundrum! on: 2013-10-09 19:01:29
how about passing the index as an enum instead of an int. Something like this (I haven't checked to make sure the syntax is correct)

public enum Edge {
    ZERO( 0, ONE, TWO ), ONE( 1, ZERO, TWO ), TWO( 2, ZERO, ONE );

    Edge( int i, Edge op1, Edge op2 ) {
        index = i;
        output1 = op1;
        output2 = op2;

    public final int index;
    public final Edge output1;
    public final Edge output2;

and then using it would look something like this
Edge ip; //input edge passed in


ip.output1.index //check edge output1
ip.output2.index //check edge output 2

I guess it's a bit more verbose than using (x+1)%3 and I have no idea about efficiency but that's another way you can do things.
2  Game Development / Newbie & Debugging Questions / Re: LWJGL Timing problem on: 2013-02-19 16:37:47
oh, my apologies. Other than wrongly assuming meaning based on your naming conventions, I don't see what's inherently wrong with your timing. Unless you're playing with the value of your delta in your update method or are somehow doing weird extrapolation in your render method, I honestly am not sure why that bug is happening for you.
3  Game Development / Newbie & Debugging Questions / Re: LWJGL Timing problem on: 2013-02-19 16:02:47
speed = (forwardSpeed * / 1000f;

if you want the speed to be constant, than you shouldn't be multiplying it's value like that. Regardless of how much time goes by, the speed shouldn't change in your case. The position does. Which brings me to my next point, that speed*time = distance, not speed again. so if you replace the speed there with your position variable like so,

position += (forwardSpeed * / 1000f;

you would get your proper position even if your delta fluctuates from lag.

4  Discussions / Miscellaneous Topics / Re: blocked in Google? on: 2013-02-18 22:18:38
I typed in java game loop and this site came up on the last entry of the first page

so it's still there, just that google has given this site a lower priority I guess
5  Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language on: 2012-09-16 07:01:57
thanks everyone for explaining this for me. I appreciate it as I try to get better.
6  Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language on: 2012-09-15 04:19:37
I guess I'm kinda new to programming to be asking this but wouldn't a class which has no methods and only data fields be the same functionality-wise as a struct? or am I missing something that java does with classes that just isn't what you want from a struct Huh
Pages: [1]
wxwsk8er (49 views)
2015-03-20 15:39:46

Fairy Tailz (42 views)
2015-03-15 21:52:20

Olo (26 views)
2015-03-13 17:51:59

Olo (29 views)
2015-03-13 17:50:51

Olo (33 views)
2015-03-13 17:50:16

Olo (40 views)
2015-03-13 17:47:07

ClaasJG (29 views)
2015-03-10 11:36:42

ClaasJG (37 views)
2015-03-10 11:33:01

Pippogeek (45 views)
2015-03-05 14:36:23

Pippogeek (37 views)
2015-03-05 13:56:12
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

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27 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!