Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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 / Newbie & Debugging Questions / To swing or not to swing?? on: 2006-02-05 07:57:22
Hi all!

I've laid the foundation for my simple Board/strategy game and was going to build some simple frames for the board, dices and news. But then, I read somewhere that one should not use swing for this?
I don't know why - so I have to ask my fellow gamemakers about their opinions?

 Huh
2  Game Development / Newbie & Debugging Questions / Re: Introduction to Java Flash Tutorials! on: 2005-02-12 05:27:26
Yep, they were nice!

But what the heck are you running? KDesktop on win32? Cygwin?
3  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-11 17:33:32
So, thanx for all the suggestions helping me out with my lousy peg solitaire.

So far, I've come to the conclusion that I should never ever never use Swing components for something like this.
I don't understand them at all. I can't get why a removed non-existent component, for example, could be visible? I have to use setVisible(false) before I remove them (I can't do it afterwards, it's removed remeber) to get the ugly Icon to disappear? Somehow, I thought the Icon belonged to the Label? Anywya, i could do that it's ok.

Now, if someone could give me some rookie help..  Smiley
I load a saved PlayBoard object using my
1  
2  
3  
ObjectInputStream in = new ObjectInputStream(new FileInputStream("savefile"));
savedBoard=(PlayBoard)in.readObject();
return savedBoard;


Now.. to actually update my game and my screen(now I don't recieve any messages, but nothing at all happens, I don't get any old board to continue playing with) ... what am I supposed to do? Will I have to run some code to actually put my objects back and run a validate() on my 81 JPanel squares or how is it all handled?

Best regards
4  Game Development / Newbie & Debugging Questions / Re: how to change applet game  to standalone on: 2005-01-11 16:49:29
You should be able to run the applet in a JFrame as far as I know?
But well, I don't know much..
5  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-07 15:46:19
Thanks!

I will try that, as soon as I've done the Swing verison. It was my courseleader (I spend my evenings after work to dig into Java) that suggested going the Swing way instead of 2D.

Well, now I have it running, as soon as I can get the Jpanel that I Jump to remove it's JLabel. i tried the removeAll() which won't do it. It doesn't update my view at least.  And I can't use the removeComponent() since I don't have that Component in a variable. Fells stupid to try to "catch" that one, and actually I don't know how to do it?
6  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-07 14:32:41
ok.. another silly question.

How do i remove the Jlabel symbolizing the ball i just jumped?
The GamePieces resides in a Vector, but removing them from there does nothing (gamePieces.remove(index)).
I suppose I have to remove the Label itself from the Jpanel where it resides somehow?

Besides I realize I'm stupid. I'm mixing Vectors of Jpanels (representing boardSquares) with vectors of Gamepieces.

Wouldn't it be easier if I only worked with the Panels and then marked them as empty/notEmpty. I suppose there is a way to see wether or not my Panel holds an object?

So this is were UML comes in... Wink

Have a nice weekend you all
7  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-07 06:56:03
Oh don't be sorry, it was too early in the morning.. I think I got a hold of it now Smiley

again, thanks for the help!
8  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-07 05:52:12
Quote


valid move = ((oldx = newx) && (Math.abs(oldy-newy) == 2) && middle square occupied)) || ((oldy = newy && (Math.abs(oldx-newx) == 2) && middle square occupied).

Kev


To be a real rookie, I can't write that one. My compiler tells me it's not legal to use && operator to find out boolean values ????
I'm I drunk or is it just to early..
9  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-07 05:26:43
Actually, "RISK" like games is exactly what I want to develop, once I get basic knowledge.

Do you have some "real" examples to show? I really like your idea with the .ini file.
10  Game Development / Newbie & Debugging Questions / Re: Peg Solitaire on: 2005-01-06 19:23:15
If it's that easy.. I really need too find my old schoolbooks again..

I'll try that, many thanks for your help!  Smiley
11  Game Development / Newbie & Debugging Questions / Peg Solitaire on: 2005-01-06 18:55:39
So .. there I am, looking at my peg solitaire board. Looks nice..

But how could I possible figure out what would be a legal move or not? I think I've missed a few part in my lousy design.

I have a Vector that contains 9x9 Jpanels that makes upp the Squares of my board-
I have an Array containing all the illegal squares(in the corners, the ones painted black that shouldn't have been in the first place.. GridLayout..)

So, when I press my mouse, I see if I'm grabbing a JLabel (my Gamepiece) and then I get the index of the parent Jpanel. When I release my mousebutton I check if the square is empty and then I can get the index of that Jpanel

But.. then what, I have two indexnumbers..? My Math isn't very good.. is there really a magic formula to control that thing?
Or should I store every objects row and column somehow, then I could see if the difference between the "fromSquare" and "targetSquare" row,column are 0,2 or 2,0. One of them must be 0 and I can only jump one square.

Then.. of course.. I must check wether or not the square I'm jumping contains a Jlabel too .. :/

As said.. my math.. my logic.. my brilliance.. that never were... Wink
12  Game Development / Newbie & Debugging Questions / Re: simple boardgames on: 2005-01-06 03:12:00
It was somewhere on the Sun Forums, do a google on chessboard and jlayeredpane. Got this one for example which looks a little like mine.
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=518707
13  Game Development / Newbie & Debugging Questions / Re: simple boardgames on: 2005-01-04 09:45:28
Hello all!

This is a very interesting thread indeed.

I'll admit, I've started with Swing components,  I found a thread somewhere with a nice example.  Me too, thought that using existing components would be an easier approach.

Well, I'll see if it will, cause I'm not there yet. I've built my board and I can drag my pieces around but that's it.
I do plan to try both approaches, as soon as I'm there with my Swing version I'll try the painting approach.


Regards
14  Game Development / Newbie & Debugging Questions / Re: That Evil MouseListener of mine.. on: 2004-12-30 09:53:08
Grin
Stupid me..  of course not. I was talking about my implementing of http://www.javaonthebrain.com/java/solitaire/

An assignment, university. Anyway, I did a ugly one, I created my 9.9 Grid of JPanels and then I hold the "dead corners" in an array, setting there BackGround to Black.
Turns out to look nice but be.. well..

This will not do in the long run though, but it keeps me safe and warm during new year.. Wink
then I'll have to do something about it.. a LOT.. actually

Regards
15  Game Development / Newbie & Debugging Questions / Re: That Evil MouseListener of mine.. on: 2004-12-30 08:52:37
Well.. it works.. now I only need to find out a way to draw that ugly board. Why can't they be satisfied with an ordinary chessboard instead of that lousy "cross" design  :-/
16  Game Development / Newbie & Debugging Questions / That Evil MouseListener of mine.. on: 2004-12-30 05:34:57
Well, nope!

To be honest, it's probably this evil morning and the lack of proper amount of coffee.

Anyway, just a thought. in the name of good "OOP" I was creating 3 classes, my GameUI, my GamePiece and my GameBoard. The thought was that the GameUI should implement the GameBoard, which extends a simple Jpanel.

That get's me into trouble since the mouseListener then should be implemeneted at the gameBoard(correct?). And then I really need to move everything called "Logic" to the GameBoard since this one must know about the different pieces and what to do with them.
In the other hand.. isn't that kind of right? To let the GameUI be a simple conatiner with menus and the GameBoard the logic part wich implements GamePieces..

Am I out on a holiday here or what do you think..?
(yep, i really feel like a Clubie)
17  Game Development / Newbie & Debugging Questions / Re: simple boardgames on: 2004-12-29 04:19:28
Well that seems to be a nice start indeed, thank you very much!  Cheesy

I'll try that out, and.. probably get back later. I feel I would need to work some on the UML part, cause there's a lot to think about indeed.

But the only way to get there is .. code, code, code!!

Regards
18  Game Development / Newbie & Debugging Questions / simple boardgames on: 2004-12-28 18:44:50
I was thinking about doing some simple boardgames. Unfortunately, most of the tutorials and books out there handle only arcade/applets .. not my type :)
(if anyone know of resources that handle these kind of games I'll be glad to read them).

Anyway.. there's a lot to think about. Should my board be intelligent for example, or should I simply dram some thing and catch the XY coordinates? I was thinking about getting oput there as simple as possible.. so I wrote a board like this:

public ChessBoard()
     {
           super("Schack Arne");
           setBounds(0,0,400,400);
           
            setLayout(new GridLayout(8,8));

             for (int i=0; i<64; i++)
             {
                 JPanel square = new JPanel();

                 if ((i+i/8)%2 == 0)
                     square.setBackground(Color.black);
                 else
                     square.setBackground(Color.white);
               add(square);


and thought about doing the gamepieces like draggable JLabels.. Do you have any thoughts about that, or any good resources for me to read? I'm really not into GUI programming at all, trying to add a simple JLabel with a picture made my Chessboard go whacky (the getcontentpane().add(Label) stuff I suppose..)

Happy New year to all of you
19  Java Game APIs & Engines / Java 2D / Re: Advice for a simple "Risk" game on: 2004-03-14 16:11:02
Sounds interesting, i haven't had the time to try it out yet, any of the solutions. Have to finish my course first.
I've always been thinking about how to do this solutions though, some year ago I started out with the same idea of a game in Python, but never managed to get a good one.
(I was thinking of using SVG graphics but never found a module to render it
Sad  )
20  Java Game APIs & Engines / Java 2D / Re: 2D Gaming Chapters now Online on: 2004-03-10 04:16:33
Not good I suppose, broken link  Cry
21  Java Game APIs & Engines / Java 2D / Re: Advice for a simple "Risk" game on: 2004-03-08 11:55:20
Now that sounds like a great advice! Time to bail out from work and do some more serious stuff Wink
22  Java Game APIs & Engines / Java 2D / Advice for a simple "Risk" game on: 2004-03-08 09:36:51
I'm a rookie in Java, recently finished my first course and are about to start a second one (concentrating in Network, JDBC and Swing).

However, coding is the best way to improve skills, so I was thinking of start coding a simple game, something like "Risk".

However, how would I create that playable Map? Should I use an "ugly" map that I don't show that catches mouseclicks, or is there a more clever solution?

Also, If anyone knows of source somewhere that could be useful to have a look at, please let me know.

Regards
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (26 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (34 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

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

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

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

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
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!