Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Syntax error on token ">", invalid AssignmentOperator help.  (Read 1324 times)
0 Members and 1 Guest are viewing this topic.
Offline Kroniz

Senior Newbie





« Posted 2012-11-09 22:32:36 »

Okay sorry if this is the wrong category or whatever but I really need help, considering this simply wont solve itself.

It says Syntax error on token ">", invalid AssignmentOperator on :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
public class Main
{
  public static String dir = "";
  public static boolean isApplet = false;

  public static int WIDTH = 900;
  public static int HEIGHT = 600;
  public static double FOVY = 70.0D;
  public static double ASPECT = WIDTH / HEIGHT;

  public static boolean mapEditor = false;
  public static boolean freeCamera = false;
  public static int nbLevel = 9;
  public static int nbChalLevel = 3;
  private Controls controls;
  private Render render;
  public static Avatar avatar;
  public static Shaders shaders;
  public static Sounds sounds;
  private long previousTime;
  private double unprocessedSeconds = 0.0D;
  private double secondsPerTick = 0.02D;
  private int tickCount = 0;
  private int frames = 0;
  public static int FPS = 0;
  public static boolean menu = false;
  public static boolean menuInit = true;
  public static boolean dead = false;
  public static long time;
  public static Map map;
  public static String mode = "Story";

  public static String user = "Tim";
  public static int levelSaved = 5;

  public void start() {
    Font.init();

    Shaders.load();
    Shaders.use();

    MapTexture.load();
    BuildList.load();
    this.render = new Render();

    avatar = new Avatar(0.3D, 1.3D, 0.3D);

    this.controls = new Controls();
    sounds = new Sounds();
    Gui.init();
    Menu.init();
    menu = true;
    Menu.menuOpening = true;
    time = 0L;
    sounds.play("back");

    gameloop();
  }

  public void gameloop()
  {
    this.previousTime = System.nanoTime();
    for (; !Display.isCloseRequested();
     this.unprocessedSeconds > this.secondsPerTick) <<- - - THIS LINE GIVES OUR BASTARDIOUS ERROR.
    {
      long currentTime = System.nanoTime();
      long passedTime = currentTime - this.previousTime;
      this.previousTime = currentTime;
      this.unprocessedSeconds += passedTime / 1000000000.0D;

      continue;

      tick();
      if ((menu) || (Menu.menuRunning) || (Map.just_loaded)) this.previousTime = System.nanoTime();
      this.unprocessedSeconds -= this.secondsPerTick;
      this.tickCount += 1;
      if (this.tickCount % 50 == 0) {
        FPS = this.frames;
        this.frames = 0;
        this.previousTime += 1000L;
      }
      this.render.draw();
      Display.update();
      this.frames += 1;
    }

    sounds.destroy();
    Display.destroy();
  }

  public void tick() {
    sounds.tick();
    if ((!menu) && (!Menu.menuRunning)) this.controls.tick();

    Gui.tick();

    if ((!menu) && (!Menu.menuRunning)) {
      time += 1L;
      if (Shaders.currentShader == Shaders.shader) Shaders.set("time", time);
      Map.tick();
      avatar.tick();
      if (dead) Timer.restart();
    }
  }

Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2012-11-09 22:41:45 »

Instead of this:

1  
2  
3  
4  
[...]
-    for (; !Display.isCloseRequested();
-     this.unprocessedSeconds > this.secondsPerTick) <<- - - THIS LINE GIVES OUR BASTARDIOUS ERROR.
[...]


You propably wanted this:


1  
2  
3  
[...]
+    while (!Display.isCloseRequested() && this.unprocessedSeconds > this.secondsPerTick)
[...]


See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Kroniz

Senior Newbie





« Reply #2 - Posted 2012-11-09 22:43:16 »

Well, I've tried, but then the line tick(); gets unreachable code.  Roll Eyes
Quite new to java :I
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #3 - Posted 2012-11-09 22:45:17 »

Yes, because you put a
1  
continue;


just before the Tick();...
continue makes your code stop and continue from the last loop entrance, which is the "while" here.
I'm not quite sure, since I've not completly found out what your code wants, but try just leaving it out.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Kroniz

Senior Newbie





« Reply #4 - Posted 2012-11-09 22:48:22 »

Thank you!

You are so nice. Works now Smiley
Was working on a LWJGL project.
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #5 - Posted 2012-11-09 22:48:59 »

Thank you!

You are so nice. Works now Smiley
Was working on a LWJGL project.

I'm glad to help Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Kroniz

Senior Newbie





« Reply #6 - Posted 2012-11-09 22:56:17 »

By the way, I admire your World Of Cube Smiley
Its nice.
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #7 - Posted 2012-11-09 22:58:23 »

By the way, I admire your World Of Cube Smiley
Its nice.

haha thanks Wink
People around here read signatures? Cool stuff Grin

(I should upload the most recent verion tho...)

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Kroniz

Senior Newbie





« Reply #8 - Posted 2012-11-09 23:00:43 »

I didnt read your signature, I just knew the name.
Cheesy
I have a suggestion: Jetpacks.
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #9 - Posted 2012-11-09 23:02:19 »

I didnt read your signature, I just knew the name.
Cheesy
I have a suggestion: Jetpacks.

Hm... I'm not working that active on this project anymore... but... dunno...
Some failures in development made me fall on my knees... slopes not working, new terrain generator not working...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (5 views)
2014-07-23 21:16:32

Riven (6 views)
2014-07-23 21:07:15

Riven (6 views)
2014-07-23 20:56:16

ctomni231 (40 views)
2014-07-18 06:55:21

Zero Volt (36 views)
2014-07-17 23:47:54

danieldean (30 views)
2014-07-17 23:41:23

MustardPeter (32 views)
2014-07-16 23:30:00

Cero (47 views)
2014-07-16 00:42:17

Riven (48 views)
2014-07-14 18:02:53

OpenGLShaders (38 views)
2014-07-14 16:23:47
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!