Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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 2476 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: 10
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!
Play the free demo of Revenge of the Titans!
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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (121 views)
2013-05-17 21:29:12

alaslipknot (129 views)
2013-05-16 21:24:48

gouessej (159 views)
2013-05-16 00:53:38

gouessej (151 views)
2013-05-16 00:17:58

theagentd (164 views)
2013-05-15 15:01:13

theagentd (149 views)
2013-05-15 15:00:54

StreetDoggy (193 views)
2013-05-14 15:56:26

kutucuk (217 views)
2013-05-12 17:10:36

kutucuk (216 views)
2013-05-12 15:36:09

UnluckyDevil (219 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.135 seconds with 22 queries.