Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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

      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

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

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 ?

Pages: [1]
EgonOlsen (75 views)
2018-06-10 19:43:48

EgonOlsen (56 views)
2018-06-10 19:43:44

EgonOlsen (76 views)
2018-06-10 19:43:20

DesertCoockie (256 views)
2018-05-13 18:23:11

nelsongames (155 views)
2018-04-24 18:15:36

nelsongames (155 views)
2018-04-24 18:14:32

ivj94 (896 views)
2018-03-24 14:47:39

ivj94 (157 views)
2018-03-24 14:46:31

ivj94 (809 views)
2018-03-24 14:43:53

Solater (173 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!