Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  Java Game APIs & Engines / Java 2D / Re: Paint program on: 2004-12-17 19:13:08
how do i draw into an image ?

sounds like a better way.

Im not storing draw 'events' into a vector.  During 'mouseDragged', it is storing all mouse points (pixel coordinates) into a vector, the program is then redrawing the points at the same time.
2  Java Game APIs & Engines / Java 2D / Re: Paint program on: 2004-12-17 09:38:28
thanks for the suggestion.

I had to redo my code as the image wasnt saving on the panel if i minimized the window.  So what i done was .... when drawing, it adds the pixel positions to a vector.  So now the complete image is stored in a vector.

I was thinking about your suggestion to capture the mouse events, but do you think i could just send the vector data to everyone ?
3  Java Game APIs & Engines / Java 2D / Re: Paint program on: 2004-12-15 17:14:26
thanks but what exactly will i be outputting though ?

How would i collect all the pixel data ?
4  Java Game APIs & Engines / Java 2D / Paint program on: 2004-12-15 09:31:20
i want to make a multiplayer pictionary game using client / server.

I have a very simple drawing program like paintbrush, just allows me to paint freehand in black.

Now when one client draws, i want the other clients to view the drawing take place in real time.  Whats the best way to stream the data / pixel coordinates out to the server ?

here is the part that draws

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  
      protected class JPaintPanel extends JPanel implements MouseMotionListener, MouseListener
      {
            public JPaintPanel()
            {
                  super() ;
                  addMouseListener(this) ;
                  addMouseMotionListener(this) ;
            }
 
            public void mouseDragged(MouseEvent arg0)
            {
                  Point p = arg0.getPoint() ;
                  getGraphics().drawLine(lastPos.x, lastPos.y, p.x, p.y) ;
                  lastPos = p ;
            }
            public void mousePressed(MouseEvent arg0)      {lastPos=arg0.getPoint();}
            public void mouseReleased(MouseEvent arg0)       {lastPos=null ;}
 
            public void mouseMoved(MouseEvent arg0) {}
            public void mouseClicked(MouseEvent arg0){}
            public void mouseEntered(MouseEvent arg0) {}
            public void mouseExited(MouseEvent arg0) {}
           
            protected Point lastPos = null ;
      }
5  Game Development / Newbie & Debugging Questions / Re: Multiplayer Pictionary on: 2004-12-14 09:13:19
thanks

i was thinking since pictionary is turn based and only one person draws at any one turn.  The coordinates of the drawing would be stored on the server, so if any disconnections occur, the server can just send the data to each client again.

then that brings me to another qeustion.  How would i actually send the coordinate info ? would it be stored in a text file ?  If it is, any suggestions on how to format it ? would the coordinates be pixel positions ?  I was going to post this in the networking forum, but it sounds like a complete newbie question, as you can tell my programming skills arent too great.

6  Game Development / Newbie & Debugging Questions / Multiplayer Pictionary on: 2004-12-14 08:06:42
hi,

i need to create a java game which demonstrates client server communication for my school coursework.  Ok ill set it straight first, im not looking for someone to do it for me !

but from a design perspective, what is required and what am i looking to do for this task ?

i understand i need to create a canvas for each player to draw on, but how would i send the data to each client to keep each screen updated in real time with the picture ?

thanks
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.

Pippogeek (36 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (41 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (60 views)
2014-09-21 02:42:18

BurntPizza (30 views)
2014-09-21 01:30:30

moogie (35 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (52 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

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

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

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!