Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (686)
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]
Dwinin (63 views)
2015-11-07 13:29:08

Rems19 (77 views)
2015-10-31 01:36:56

Rems19 (69 views)
2015-10-31 01:32:37

williamwoles (103 views)
2015-10-23 10:42:59

williamwoles (91 views)
2015-10-23 10:42:45

Jervac_ (105 views)
2015-10-18 23:29:12

DarkCart (131 views)
2015-10-16 00:58:11

KaiHH (114 views)
2015-10-11 14:10:14

KaiHH (153 views)
2015-10-11 13:26:18

BurntPizza (167 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!