Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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  
  Web Start  (Read 2816 times)
0 Members and 1 Guest are viewing this topic.
Offline zeroone
« Posted 2006-10-18 15:32:49 »

If we make the game a Web Start application, how do you measure the size of the jar?  What's the deal with manifests and signing?
Offline woogley
« Reply #1 - Posted 2006-10-18 15:47:12 »

take a peek at last year's rules

at the end of the contest, I have a small program that downloads all JNLPs, reads them, and downloads all the resources onto my harddrives into individual folders for each game. I then can see the size at the click of a button. A signed jar that is greater than 4096 bytes is allowed only if you provide the exact same jar unsigned that is <= 4096 bytes. you are able to provide both webstart and unsigned jar file on the submission page.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2


Make it work; make it better.


« Reply #2 - Posted 2006-10-18 18:50:07 »

Don't forget you only need to sign the jar if you are going to use fullscreen.  Otherwise it will work unsigned.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zeroone
« Reply #3 - Posted 2006-10-18 19:04:53 »

Really?!  For the Web Start version, do we need a manifest?
Offline woogley
« Reply #4 - Posted 2006-10-18 19:40:47 »

Really?!  For the Web Start version, do we need a manifest?

nope. be sure pass the "M" (uppercase) to the jar command to avoid creating a manifest. the JNLP allows you to specify what the main class is.

with this in mind, sometimes distributing with webstart is smaller than distributing standalone JARs.

in addition to fullscreen, most people prefer to sign to get rid of the "Java Application Window" message, which can get in the way of some game graphics if they're drawing directly to the JFrame. (also some classes such as Robot need signing to use)

standalone JARs never ever have the "Java Application Window" message, and never need to be signed to use any classes. so the balance typically is: "I don't need a manifest, but I might need to sign." (webstart) and "I don't need to sign, but I do need a manifest for it to run" (standalone jar)
Offline zeroone
« Reply #5 - Posted 2006-10-18 19:51:12 »

By drawing directly to the JFrame, do you mean calling createBufferStrategy() and flipping those buffers vs. drawing to a BufferedImage and displaying that image on the content pane?

Why would you use the Robot class in a game?
Offline woogley
« Reply #6 - Posted 2006-10-18 19:55:42 »

By drawing directly to the JFrame, do you mean calling createBufferStrategy() and flipping those buffers vs. drawing to a BufferedImage and displaying that image on the content pane?

BufferStrategy (from the JFrame as opposed to a Canvas) would be drawing directly to the JFrame, as well as calling JFrame.getGraphics().drawImage(buffer,0,0,null);

I usually shove a JPanel onto the JFrame and use the JPanel's graphics to render. (well that's what I do in 4K, anyway Tongue)

Why would you use the Robot class in a game?

to trap the mouse. (think of an FPS: you should be able to move the mouse inifinitely in any direction to move the camera around. by using Robot, you can wrap the mouse back to the original location so it can continue to freely move)
Offline zeroone
« Reply #7 - Posted 2006-10-18 20:06:19 »

Quote
I usually shove a JPanel onto the JFrame and use the JPanel's graphics to render. (well that's what I do in 4K, anyway )

By that, do you mean you render to a BufferedImage and then draw that image to the JPanel?  Is it better to extract the content pane and cast it to a JPanel or to create a new JPanel and make that the content pane? 
Offline woogley
« Reply #8 - Posted 2006-10-18 20:16:59 »

*blink*

I do it like this (I only do it this way for 4K, as it is bad design)

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  
public class Game {
   public static void main(String args[]) {
      JFrame f = new JFrame();
      JPanel p = new JPanel();
      // size of the game, regardless of
     // any "java application window" messages
     p.setPreferredSize(new Dimension(640,480));
      f.getContentPane().add(p,BorderLayout.CENTER);
      f.pack();
      f.show();
      BufferedImage b = new BufferedImage(640,480,BufferedImage.TYPE_INT_ARGB);
      while (true) { // game loop
        // update stuff
        // ...


         Graphics gfx = b.createGraphics();
         // draw stuff to buffer
        // ...

         // render to screen
        Graphics g = getGraphics();
         if (g != null) g.drawImage(b,0,0,null);
         g.dispose();
         gfx.dispose();
      }
   }
}


.. or something like that (that's off the top of my head, uncompiled). take a look at the Goomba4K source for a better idea of how I do it.
Offline zeroone
« Reply #9 - Posted 2006-10-18 20:37:35 »

Cool.
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 (22 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (189 views)
2014-04-01 02:16:10
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

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