Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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: Transform Color Transparent! on: 2003-01-29 02:29:15
Here you go, have fun Wink :
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  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
      /**
       * Gets the image pixels in a one dimension array
       * @param img the original image
       * @return int[] the image's pixels
       */

      public static final int[] getPixels(Image img) {
            final int[] pix = new int[img.getWidth(null) * img.getHeight(null)];
            final PixelGrabber pg =
                  new PixelGrabber(
                        img,
                        0,
                        0,
                        img.getWidth(null),
                        img.getHeight(null),
                        pix,
                        0,
                        img.getWidth(null));
            try {
                  pg.grabPixels();
            } catch (InterruptedException e) {
            }
            return pix;
      }
      /**
       * Converts a unidimensional array of pixels into an image
       * @param pixels the image's pixels
       * @param w the image width
       * @param h the image height
       * @return Image the resulting image
       */

      public static final Image getImage(int[] pixels, int w, int h) {
            return Toolkit.getDefaultToolkit().createImage(
                  new MemoryImageSource(w, h, pixels, 0, w));
      }

      /**
       * This applies an alpha mask, removing all images coicident to argument's
       * Color. This doesn't alter the original image.
       * @param img the image you want to transform
       * @param keyColor the color you want to become invisible
       * @return Image the resulting image
       */

      public static final Image applyKeyColorMask(Image img, Color keyColor) {
            final int w = img.getWidth(null);
            final int h = img.getHeight(null);
            final int[] pxls = getPixels(img);
            final int blank = new Color(255, 0, 0, 0).getRGB();
            for (int i = 0; i < pxls.length; i++) {
                  if (pxls[i] == keyColor.getRGB()) {
                        pxls[i] = blank;
                  }
            }
            return getImage(pxls, w, h);
      }
2  Java Game APIs & Engines / Java 2D / Native Graphics Libraries on: 2003-01-29 02:23:11
I would like to know which native are available out there, the ones i
found so far:

jsdl -> http://jsdl.sourceforge.net/
Seems to be the more "official" approach to the SDL bindings yet i didn't have any succes on trying to put it working, i tried the source, the binaries and the CVS version but strange and different errors with each of these tries. Angry

jgamelib -> http://www.binary-magic.net/oss/jgamelib/
Another SDL bindings but i can't seem to find a way to put images from files on screen, it has bindings for OpenGL and OpenAL but i can only find Sdl and OpenGL related files in the sources...

allegroj -> http://www.mythras.demon.co.uk/allegroj/
Very simple with bitmaps support and even simple effects, like line drawing, seems to be the only working one and hasn't been updated for at least an year Sad

lwjgl -> http://java-game-lib.sourceforge.net/
Seems to be the more complete but i don't want/need 3D support, unless i knew how to do a simple 2D game with OpenGL, but i'll save it for another post  Grin

Do you know of anymore? I use linux so if you know one that only supports linux it's ok anyway.
3  Game Development / Game Mechanics / Re: jump mario on: 2003-01-26 22:35:44
Hi, i'm also developing a platforms style game in my spare time, and i've alredy developed that part of the game that you need, the Phisics Engine (that allows your "mario" to jump, and also slide) and a collision engine (that will allow "mario" to know where he's hitting) if you're interested i can send you the source code, it's not very well commented (because i didn't have time to do it) but it's simple enough for you to understand (if you come across a big problem i can help you out).
While browsing java-gaming.org i've came across a game that might interest you, it's a commander keen clone:
http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=Announcements;action=display;num=1038469923
I didn't have time to look into the game's source code but it's a pretty nice beggining of a game.
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.

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

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

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

Riven (21 views)
2014-07-23 20:56:16

ctomni231 (50 views)
2014-07-18 06:55:21

Zero Volt (45 views)
2014-07-17 23:47:54

danieldean (36 views)
2014-07-17 23:41:23

MustardPeter (39 views)
2014-07-16 23:30:00

Cero (54 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
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

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!