Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (499)
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  
  a little help with my first game  (Read 3228 times)
0 Members and 1 Guest are viewing this topic.
Offline newbieprogramer

Junior Newbie




I have about 2 months of programming experiance


« Posted 2004-04-09 19:45:52 »

well where do i start i read a few books etc look on sun website got info and etc but ive got like 2 bugs in this and i dnt know how to solve them ive tried everything.

so heres the code its probably all wrong anyways:-

public class DarkRealmsCanvas
     extends Canvas
     implements Runnable  {

public static void main (strings [] args);

private LayerManager mLayerManager;

public DarkRealmsCanvas() throws IOException {
    super (true);

    TiledLayer createTile() {
    Image image = null;
    try { image = Image.createImage ("/tile1.bmp"); }
    catch (IOException ioe) {return null;
};

    TiledLayer tiledLayer = new TiledLayer (10, 10,  image, 16,16);

    int [ ]  map = {
1,  2,  3,  0,  1,  0,  1,  2,  2,  3,
1,  2,  3,  0,  1,  0,  1,  2,  2,  2,
1,  2,  3,  2,  1,  0,  1,  2,  2,  3,
0,  2,  3,  0,  1,  0,  1,  2,  3,  1,
1,  2,  3,  0,  1,  0,  1,  2,  2,  3,
3,  2,  3,  1,  1,  0,  1,  2,  1,  3,
1,  2,  3,  0,  1,  0,  1,  2,  2,  3,
1,  2,  3,  0,  1,  0,  1,  2,  2,  3,
2,  2,  3,  3,  1,  0,  1,  2,  2,  3,
1,  2,  3,  0,  1,  0,  1,  2,  2,  0
};

for (int i = 0;  i < map. length; i++);  {
  int column = i % 10;
  int row = (i - column) /10;
  tiledLayer.selectCell (column, row, map[ i ] );
};
return tiledLayer;
}


//so let me know wot you think i should do plz.
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2004-04-09 19:56:03 »

I think you shoudl tell us exactly what your bugs are, with stack traces if there are exceptions.

(You should also fix the spelling of "anyways" too, this isn't a leet dewd chat room Wink )

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline newbieprogramer

Junior Newbie




I have about 2 months of programming experiance


« Reply #2 - Posted 2004-04-09 20:05:14 »

well like, DarkRealms.java:39: ';' expecting

and

DarkRealms.java:39: '}' expecting

but i checked and they are both there.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #3 - Posted 2004-04-09 20:15:45 »

I'm not analyzing the logic, just looking at syntax...

Quote
public static void main (strings [] args);
  • Syntax for array of strings: String[]
  • Methods must have a body
    1  [/li][/list]
    public static void main(String[] args) { **body** }
    unless you declare them "abstract" (which wouldn't make sense for a main method anyways). IMHO, you could eliminate the main method (since this is just a canvas) altogether.

Constructor doesn't seem to have closing brace.
Make sure you import the necessary classes/packages.
Finally, you implement Runnable but do not define a run() method.

Hope this helps.

BTW what IDE are you using? The code would look much cleaner if you used a decent IDE...

Enjoy.
Regards,
     - D.t.O
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2004-04-09 20:18:53 »

Quote
well like, DarkRealms.java:39: ';' expecting

and

DarkRealms.java:39: '}' expecting

but i checked and they are both there.


Okay now what is line 39?



Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #5 - Posted 2004-04-09 20:23:51 »

If there are no import statements, package declarations, etc., then line 39 is the last line, I think.

Enjoy.
Regards,
     - D.t.O
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #6 - Posted 2004-04-09 20:27:08 »

I think the missing '}' is due to the constructor, which is missing the closing brace.

As for the missing ';', I found the for loop
Quote
for (int i = 0;  i < map. length; i++);  {
  int column = i % 10;
  int row = (i - column) /10;
  tiledLayer.selectCell (column, row, map[ i ] );
};

Has two extra ';'s. The first line does not need a semicolon (unless you want to loop with an empty statement) and the last line does not need one either.

Enjoy.
Regards,
     - D.t.O
Offline newbieprogramer

Junior Newbie




I have about 2 months of programming experiance


« Reply #7 - Posted 2004-04-10 12:15:02 »

Quote
BTW what IDE are you using? The code would look much cleaner if you used a decent IDE...
well i wasn't using one, i was just usin notepad and ms-dos prompt. but i am now using jPadPro is that anygood?

EDIT: well i was going to use it but it didn't install properly so im just going to use notpad for now.
Offline Stanky

Senior Newbie




Java games rock!


« Reply #8 - Posted 2004-04-10 19:00:56 »

Quote

well i was going to use it but it didn't install properly so im just going to use notpad for now.


I am a big fan of Eclipse. www.eclipse.org. Great for java, but useful for other stuff too. Gives you warnings, errors, debugger, code browser, etc. You'll torture yourself using notepad and a dos prompt.
Offline newbieprogramer

Junior Newbie




I have about 2 months of programming experiance


« Reply #9 - Posted 2004-04-10 19:29:09 »

thanks is this a free program or does it have a trial period like the one i was going to use?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #10 - Posted 2004-04-10 20:25:35 »

Eclipse is free, open-source, etc. No trial periods, ads, or anything.
Personally, I like NetBeans (http://www.netbeans.org) better. Check both out and decide yourself Wink

Enjoy.
Regards,
     - D.t.O
Offline Jeff

JGO Coder




Got any cats?


« Reply #11 - Posted 2004-04-10 21:22:35 »

And I like JBuilder.  There is a free "personal"edition thats quite decent. (Though to be honest I use the whole mosterous enterprise suite because I also use Together and OptimzieIt)

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline pedro

Junior Member




Java games rock!


« Reply #12 - Posted 2004-04-11 00:41:46 »

Has anyone checked it out the Sun Creator Studio? I get the idea it's oriented towards development of web services, but just downloaded a copy today and we'll see what I think.  I tried NetBeans and Eclipse, and ended up sticking with Eclipse. It runs faster on my machine and looks nicer Grin
Offline D.t.O

Junior Member




Psych'd about Java Games


« Reply #13 - Posted 2004-04-11 02:44:04 »

Yeah, I just installed Creator today, too. I think Sun's making a pretty big deal out of it (esp. because the final release is probably NOT going to be free)...
The IDE itself is Web and DB focused, and it's all visual drag-and-drop style. Plus, it's built on the NetBeans Tongue platform Wink

Enjoy.
Regards,
     - D.t.O
Offline ENC

Junior Member





« Reply #14 - Posted 2006-10-26 03:39:34 »

Plus, it's built on the NetBeans Tongue platform Wink

Eclipse is built on NetBeans? I thought Eclipse is the basic program itself! But I know RAD (Rational Application Developer) is bulit on Eclipse...

Another question, other than JBuilder, JCreator, JEdit, JGrasp. Is there any free IDEs still? I wish to try it out...

I have tried JCreator , JEdit and JGrasp. But I still find JCreator rocks. ^^

Cheers!
Offline cylab

JGO Knight


Medals: 34



« Reply #15 - Posted 2006-10-26 09:58:58 »

Sun Creator Studio ist built on Netbeans. Eclipse is completely independent of Netbeans and Sun. There are a couple of good text ediotors with java and project support out there, but they all lack refactoring and realtime error-highlighting, so they are no alternative to Eclipse or Netbeans (at least for me). If only IDEA had a free personal edition, it's so hard to get away from it, once you get addicted...

Mathias - I Know What [you] Did Last Summer!
Offline michael.becerra

Senior Newbie





« Reply #16 - Posted 2006-11-16 18:52:10 »

Quote
I have tried JCreator , JEdit and JGrasp. But I still find JCreator rocks. ^^

Not sure if you tried JCreator LE or Pro 4.x but, i'm using JCreator Pro 4.025 and its x10 better then its LE counterpart.

Space Xscape Development Team
Space Xscape
Progress:----------
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #17 - Posted 2006-11-16 19:20:45 »

* oNyx slaps ENC

Stop necroing zombie threads.

ffs.

弾幕 ☆ @mahonnaiseblog
Offline ENC

Junior Member





« Reply #18 - Posted 2006-11-17 01:49:18 »

* oNyx slaps ENC

Stop necroing zombie threads.

ffs.

If you noticed... it was brough up in October... >.< I already stopped responding to this tread... and the bring up old threads is resolved in October as well... pls do not raise the topic again.,.. anyway is michael.becerra who founc this thread today...

 Undecided
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #19 - Posted 2006-11-17 02:09:21 »

Hehe. Sorry... that was the default blame ENC reflex Smiley

弾幕 ☆ @mahonnaiseblog
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.

xsi3rr4x (44 views)
2014-04-15 18:08:23

BurntPizza (40 views)
2014-04-15 03:46:01

UprightPath (56 views)
2014-04-14 17:39:50

UprightPath (38 views)
2014-04-14 17:35:47

Porlus (54 views)
2014-04-14 15:48:38

tom_mai78101 (77 views)
2014-04-10 04:04:31

BurntPizza (136 views)
2014-04-08 23:06:04

tom_mai78101 (236 views)
2014-04-05 13:34:39

trollwarrior1 (197 views)
2014-04-04 12:06:45

CJLetsGame (205 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!