Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 [2] 3 4 ... 7
31  Games Center / 4K Game Competition - 2006 / Re: Mario 4k on: 2006-01-10 05:12:49
Very cool, but it runs REALLY fast on my PC!  Any chance on having the movement time based?
32  Discussions / General Discussions / Re: Forum rules sticky on each forum on: 2006-01-03 18:44:49
I like the idea of a "Rules" button near the "Help" or "Home" button.  That way when you tell someone to read the rules they will know right where to find them!
33  Games Center / 4K Game Competition - 2006 / Re: Star Fighter 4K on: 2005-12-30 18:35:11
I think this is an awesome game!!  I have played it for a while and the only issue I had was that I had a hard time telling when I hit the boss, but that's not really that big of a problem!  Very good job!!!
34  Discussions / General Discussions / Re: chess game in colour - help wanted on: 2005-12-13 20:45:02
The applet worked for me, but you can only take players of the same color. The description said opposite, that took a little while to figure out.  As for counting players moves you keep track of whose turn it is and whether they make a valid move or an invalid one, just att the code to increment the counter to  where that all happens.
35  Discussions / General Discussions / Re: In-browser 3D engines --suggestions? on: 2005-12-12 17:20:46
It depends on how much you want to do by hand and how much you want the engine to take care of.  I am developing an application at work that runs in a browser using LWJGL but has a Java2D fallback.  This implementation requres that everything is done by hand so we are building out own engine as we go along.  We figure that this will let us swap out bindings and rendering technology if need be without much trouble!  If you decide to go this route I could give you some pointers that'll save you some time!  Grin
36  Java Game APIs & Engines / OpenGL Development / Re: Background Loading on: 2005-12-12 01:45:21
 Roll Eyes Oh, yeah
37  Java Game APIs & Engines / OpenGL Development / Background Loading on: 2005-12-10 05:01:43
I just thought of this and wondered if it was possible.  If I had an OpenGL context that was shared between a Display and a Pbuffer, could I load data into the Pbuffer in the background while using the Display to render.  That way, if I had a large open world I could load data that was getting close enough to see, so that it would be in memory once I got close enough to see it.  Like I said I don't know if this would work and it's rather late so if I'm talking crazy, just let me know!
38  Game Development / Newbie & Debugging Questions / Re: Map problem. Please help!!! on: 2005-12-09 21:56:28
Yeah, Java2D would be the way to go for that!  It's totally doable, but it's going to require a lot of work!  I hope it works out for you!
39  Games Center / Archived Projects / Re: Blobbit Dash (Win/OSX/Linux) on: 2005-12-09 20:24:58
Very well done!!  Good job!
40  Java Game APIs & Engines / OpenGL Development / Re: glBitmap() on: 2005-12-09 18:15:12
Ok, I figured it out!  I needed to add
1  
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
to my initGL() method.  The I saw that it only displayed the first letter of the string and it was upside down.  Turns out that OpenGL needs to have the bytes specified fromt eh bottom up, not the top down, so I flipped that and got the first letter right side up.  Then I realized that it wasn't stepping through the ByteBuffer so I added the following code to the render() method.
1  
2  
3  
4  
5  
6  
7  
GL11.glRasterPos2f(0f, 0f);
stringBuffer.rewind();
for(int h = 0; h < temp.length(); h++)
{
   GL11.glBitmap(5, 8, 0, 0, 6, 0, stringBuffer);
   for(int i = 0; i < 8; i++) stringBuffer.get();
}


Now it looks like this!

41  Discussions / General Discussions / Re: PLEASE, HELP! on: 2005-12-09 15:50:10
I have used JDIC and it allows you to put an Icon in the TaskBar and to minimize to that icon, but your program is still running, so you could have it so that clicking on the minimize button just did a currentFrame.setVisible(false); and then clicking on the icon in the task bar did a currentFrame.setvisible(true);, then it would never forget what page it was looking at!
42  Java Game APIs & Engines / OpenGL Development / glBitmap() on: 2005-12-08 21:40:30
I am trying to mimic the glBitmap() example in the Red Book, but having no luck!  Here is the important bits of code:
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  
HashMap<String, byte[]> font = new HashMap<String, byte[]>(36);

private void buildTable()
{
   font.put("A", new byte[]{(byte)0x70, (byte)0x88, (byte)0x88, (byte)0x88, (byte)0xF8, (byte)0x88, (byte)0x88, (byte)0x00});
   font.put("B", new byte[]{(byte)0xF0, (byte)0x88, (byte)0x88, (byte)0xF0, (byte)0x88, (byte)0x88, (byte)0xF0, (byte)0x00});
   font.put("C", new byte[]{(byte)0x70, (byte)0x88, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x88, (byte)0x70, (byte)0x00});
   font.put("D", new byte[]{(byte)0xF0, (byte)0x90, (byte)0x88, (byte)0x88, (byte)0x88, (byte)0x90, (byte)0xF0, (byte)0x00});
   font.put("E", new byte[]{(byte)0xF8, (byte)0x80, (byte)0x80, (byte)0xF0, (byte)0x80, (byte)0x80, (byte)0xF8, (byte)0x00});
   font.put("F", new byte[]{(byte)0xF8, (byte)0x80, (byte)0x80, (byte)0xF8, (byte)0x80, (byte)0x80, (byte)0x80, (byte)0x00});
   ...
   font.put("2", new byte[]{(byte)0x70, (byte)0x88, (byte)0x08, (byte)0x10, (byte)0x20, (byte)0x40, (byte)0xF8, (byte)0x00});
   font.put("3", new byte[]{(byte)0xF8, (byte)0x10, (byte)0x20, (byte)0x10, (byte)0x08, (byte)0x88, (byte)0x70, (byte)0x00});
   font.put("4", new byte[]{(byte)0x10, (byte)0x30, (byte)0x50, (byte)0x90, (byte)0xF8, (byte)0x10, (byte)0x10, (byte)0x00});
   font.put("5", new byte[]{(byte)0xF8, (byte)0x80, (byte)0xF0, (byte)0x08, (byte)0x08, (byte)0x88, (byte)0x70, (byte)0x00});
   font.put("6", new byte[]{(byte)0x30, (byte)0x40, (byte)0x80, (byte)0xF0, (byte)0x88, (byte)0x88, (byte)0x70, (byte)0x00});
   font.put("7", new byte[]{(byte)0xF8, (byte)0x08, (byte)0x10, (byte)0x20, (byte)0x40, (byte)0x40, (byte)0x40, (byte)0x00});
   font.put("8", new byte[]{(byte)0x70, (byte)0x88, (byte)0x88, (byte)0x70, (byte)0x88, (byte)0x88, (byte)0x70, (byte)0x00});
   font.put("9", new byte[]{(byte)0x70, (byte)0x88, (byte)0x88, (byte)0x78, (byte)0x08, (byte)0x10, (byte)0x60, (byte)0x00});
}

public ByteBuffer text(String text)
{
   ByteBuffer retBuffer = ByteBuffer.allocateDirect(text.length()*8).order(ByteOrder.nativeOrder());
   byte[] letter;
   
   for(int i = 0; i < text.length(); i++)
   {
      letter = font.get(text.substring(i, i+1).toUpperCase());
      if(letter == null) letter = font.get("*");
      retBuffer.put(letter);
   }
   retBuffer.flip();
   retBuffer.rewind();
   return retBuffer;
}

private void render()
{
   // clear background
   GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
   GL11.glLoadIdentity();
   GL11.glTranslatef(0.0f, 0.0f, -1f);
   
   stringBuffer = text("A");
   
   GL11.glRasterPos2f(0f, 0f);
   GL11.glBitmap(5, 8, 0, 0, 8, 0, stringBuffer);
}


This is what I get:



If I change the
1  
stringBuffer = text("A");
to
1  
stringBuffer = text("AAAAAAAAAA");
I get this:



What am I doing wrong?
43  Games Center / 4K Game Competition - 2006 / Re: AirPong4k on: 2005-12-08 16:49:36
Amazing work!  Shocked
44  Games Center / 4K Game Competition - 2005 / Re: Kick 4K on: 2005-12-08 05:20:14
I like the music!  Kinda reminds me of MegaMan! Cheesy
45  Discussions / Community & Volunteer Projects / Re: Java proof of concept game on: 2005-12-08 05:16:49
 Grin  I am glad to see this thread has turned around!  The first few posts seemed to be a lot of FUD, but now he's getting great suggestions!!  I love this place!
46  Game Development / Newbie & Debugging Questions / Re: Regex help (50th time already, sorry) on: 2005-12-07 19:04:25
Let me start off my saying that I am partial to StringTokenizers!  BUT, if you read a line and pass that to a tokenizer then getting the first token will tell you whether the data will have 3 or 4 parts to it.  Unless the sample you posted isnot representative!  For example:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
StringTokenizer tokenizer = new StringTokenizer(line);
String temp = tokenizer.nextToken();
if(temp.equals("v"))
{
    // 3D Stuff
}
else if(temp.equals("f"))
{
    // 4D Stuff
}
47  Game Development / Newbie & Debugging Questions / Re: Ignoring words if not contained in array. on: 2005-12-06 23:06:00
What about ArrayLists?
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
String list[];
ArrayList<String> userText = new ArrayList<String>();
ArrayList<String> pirateVocabulary = new ArrayList<String>();

list = new String[] {"hello", "hi",  "pardon me", "excuse me", "my", "friend", "sir", "madam", "miss", "stranger", "where", "is", "the", "you", "tell", "know", "how far", "old", "attractive", "happy", "nearby", "restroom", "restaurant", "hotel", "pub", "bank"};
for(int i = 0; i < list.length; i++)
{
   userText.add(list[i]);
}

list = new String[] {"ahoy",  "yo-ho-ho", "avast", "arrr", "me", "me bucko", "matey", "proud beauty", "comely wench", "scurvy dog", "whar", "be", "th'", "ye", "be tellin'", "be knowin'", "how many leagues", "barnacle-covered", "comely", "grog-filled", "broadside", "head", "galley", "fleabag inn", "Skull & Skuppers", "buried treasure"};
for(int i = 0; i < list.length; i++)
{
   pirateVocabulary.add(list[i]);
}

System.out.println(userText.indexOf(testString) > 0 ? pirateVocabulary.get(userText.indexOf(testString)) : testString);

That last line says if the index of the testString is not negative, print out the corresponding word from the PirateVocabulary, or else return the original string
48  Game Development / Newbie & Debugging Questions / Re: Question on IO redirection on: 2005-12-05 20:44:15
You could do something like this
1  
2  
3  
4  
5  
6  
7  
8  
9  
Vector lines<String> = new Vector<String>();
BufferedReader br = new BufferedReader(...);
String temp;
temp = br.readLine();
while(temp != null)
{
    lines.add(temp);
    temp = br.readLine();
}

That is if I understand what you're asking!
49  Game Development / Newbie & Debugging Questions / Re: Program to demonstrate dance moves (classical, modern, tap - dance) on: 2005-12-05 15:29:38
You would need to set the bones up as a hierarchy and Instead of (X,Y,Z) you would need to feed in the amout of rotation of each bone relative to the parent bone.  For ecample, if you wanted the model to raise it's arm to be parrallel to the floor, then you would tell it to rotate the "forearm" bone 90 degrees around the X axis.  This would effect the hand and all of the fingers because those are the children of the forearm, but not the upperarm because it is the parent.

I'm pretty sure that's how it would work, but I've never tried, can anyone correct me?
50  Game Development / Artificial Intelligence / Re: Projection Matrix on: 2005-12-05 15:21:25
 Grin  Thank you for trying!!  I really do appreciate it!  We have decided that it is beyond us too, so we are just going to make the math as efficient as possible and try to buy speed everywhere else!!
51  Games Center / 4K Game Competition - 2006 / Re: Gumblocks4k on: 2005-12-02 21:46:54
It's a manipulated photo of an eye that I got from deviantart.com.  It was meant to me a wallpaper, but I thought that was too much!  They have a lot of very cool things there!
52  Games Center / 4K Game Competition - 2006 / Re: Frag4k on: 2005-12-02 21:45:12
How many levels are there?  I think I beat level 8 and then it went to level 8 again in a different color... Or I am just crazy! Tongue
53  Games Center / 4K Game Competition - 2006 / Re: Gumblocks4k on: 2005-12-02 21:29:08
Cheesy That's a very simple idea, but also lots of fun!  Very stressful near the end!  I was clicking like a mad man! Cheesy
54  Java Game APIs & Engines / OpenGL Development / Re: Generating Textures on: 2005-12-01 16:27:58
Is there a difference when it comes to generating textures under Windows vs. under Linux?  When I run the program on my Windows box I get this.

When I run it on the Linux target box I get this.

I changed the color of the quad that I am texturing to red so I could see the extent of it, but the "weather" is the same!!  It looks to me like some kind of a buffer issue.  What do you guys think? Huh

-=EDIT=-
I ran my proof of concept app on the Linux box and it ran like a champ, now I believe that it has somethign to do with how I read the file.  In the proof of concept app I read it from the file system, in the real app I read it from the network.  Well at least I know I am not crazy! (well, not totally anyway Wink )

-=EDIT, AGAIN=-
 Roll Eyes Ok, you can completely ignore this post!  I did a stupid thing with reusing variable names!   Embarrassed
55  Games Center / 4K Game Competition - 2006 / Re: Alpha Shot 4K on: 2005-12-01 00:52:47
I really like the particle systems!  Very cool!!
56  Game Development / Newbie & Debugging Questions / Re: Program to demonstrate dance moves (classical, modern, tap - dance) on: 2005-11-30 22:24:09
The video game folks spend a great deal of time modeling these behaviors!  And there is a very limited set of motions, unlike dance!  One of the more complicated parts would be blending the animations.  For example, if the end of one move leaves you in a squatted position, and the next invloves raising up on the toes!  In video games you can have an "idle" stance that all animations start from and end at so they blend together seamlessly.  Not so in dance!  I am not saying don't try!  Not by any means!  I just want you to know what you're in for!  Grin  I feel the same way about Arabic word processors, but hell, someone did it!
57  Game Development / Newbie & Debugging Questions / Re: Program to demonstrate dance moves (classical, modern, tap - dance) on: 2005-11-30 21:27:00
In movies they use motion suits to map a persons movement to a 3D model, but that would require that at least the person in the suit knows the dance.  I still don't understand why the teachers can't just film themselves?!
58  Java Game APIs & Engines / OpenGL Development / Re: Generating Textures on: 2005-11-30 19:45:30
 Grin Thanks to you guys, I've got that part done!!!  Here is what I did:
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  
/* Find the closest Power-of-Two */
while(!done)
{
   if(width < pattern[0].length) width *= 2;
   if(height < pattern.length) height *= 2;
   if(width >= pattern[0].length && height >= pattern.length) done = true;        
}

/* Create a BufferedImage to draw to */
glAlphaColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
            new int[] {8,8,8,8},
            true,
            false,
            ComponentColorModel.TRANSLUCENT,
            DataBuffer.TYPE_BYTE);
raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,width,height,4,null);
weatherImage = new BufferedImage(glAlphaColorModel,raster,false,new Hashtable());
Graphics g = weatherImage.getGraphics();

// Draw to BufferedImage stuff here

/* Scale the image to a reasonable size */
Image image = weatherImage.getScaledInstance(width/4, height/4, Image.SCALE_REPLICATE);
raster = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,width/4,height/4,4,null);
weatherImage = new BufferedImage(glAlphaColorModel,raster,false,new Hashtable());
g = weatherImage.getGraphics();
g.drawImage(image, 0, 0, null);

/* Turn that into a Texture */
byte[] data = ((DataBufferByte) weatherImage.getRaster().getDataBuffer()).getData();
imageBuffer = ByteBuffer.allocateDirect(data.length);
imageBuffer.order(ByteOrder.nativeOrder());
imageBuffer.put(data, 0, data.length);
imageBuffer.flip();

GL11.glGenTextures(weatherTexture);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, weatherTexture.get(0));
GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL);

GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);

GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width/4, height/4, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, ImageBuffer);

The whole thing (reading from the file, creating the BufferedImage, drawing to it, scaling it, and turing that into a texture) went from taking ~5.5 sec. to taking ~2.5 sec!  Most of that is eaten up by the buffer manipulation, I'll look into that and see if there is anything else I can do!  Now if I can figure out the Alpha bit I am all set!

-=EDIT=-
It seems that the call to drawImage() is taking up ~1.5 sec. all by itself! Sad  Does anyone know of a better way to do this?
59  Java Game APIs & Engines / OpenGL Development / Re: Generating Textures on: 2005-11-30 18:42:15
 Shocked The image is a power of two, but it's huge!!!  I printed out the size and it's 4096x2048!!!!  The issue is, probably, that I need to bring it down to a reasonable size first!  The mipmap was probably buying me that as well!
60  Java Game APIs & Engines / OpenGL Development / Re: Generating Textures on: 2005-11-30 17:28:01
Using GL_NEAREST looks awesome!  And you were right, I don't need mipmaps, I just need a texture, but when I change this line
1  
GLU.gluBuild2DMipmaps(GL11.GL_TEXTURE_2D, 3, width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, imageBuffer);
to this
1  
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, 3, width, height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, imageBuffer);
it throws this exception
1  
2  
3  
4  
5  
6  
7  
Exception in thread "main" org.lwjgl.opengl.OpenGLException: Invalid value (1281)
   at org.lwjgl.opengl.Util.checkGLError(Util.java:56)
   at org.lwjgl.opengl.Display.update(Display.java:567)
   at Main.render(Main.java:326)
   at Main.run(Main.java:282)
   at Main.<init>(Main.java:57)
   at Main.main(Main.java:49)
What does that mean?!  Huh
The only difference between the calls is that I tell it that this is the base image and that it shoun't have a border, right?
Pages: 1 [2] 3 4 ... 7
 
DesertCoockie (52 views)
2018-05-13 18:23:11

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

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

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

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

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

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
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
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!