Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: 1 ... 97 98 [99] 100 101 ... 116
1471
Support / Re: Using FrameBuffer's Graphics With AWTGLCanvas
« on: June 18, 2009, 05:23:50 pm »
Thanks to both of you again. I'm not sure the Overlay class would be my first choice, but I'll give it a try to see what happens. And Egon, a lot of my games use animated gifs. You load them as you would a static image, but with every iteration of the game loop Java2D draws a different frame (and loops them too).

1472
Support / Re: Using FrameBuffer's Graphics With AWTGLCanvas
« on: June 18, 2009, 08:04:56 am »
I want to draw an animated gif.

1473
Support / Using FrameBuffer's Graphics With AWTGLCanvas
« on: June 17, 2009, 11:27:18 pm »
I actually solved the ArrayIndexOutOfBoundsException. That little program I had written over a few years (it was the first one I built with jPCT) and it uses both the software and the hardware renderer (not at the same time obviously). And in changing it a million times I had introduced a stupid glitch in which I called run in one part of it (one attempt at getting the non-canvas OpenGL renderer to use the software loop), and started a separate thread that called it. So sometimes, draw() was being called twice at the same time (and before it draws it moves the objects). So that's that.

But now here's a question: what's the point of using AWTGLCanvas if the FrameBuffer's Graphics object will still be null (or useless, whichever it is)? I can no more use canvas.getGraphics()'s Graphics instance than I could a frame's (I can, but the screen will flicker). So is this a jPCT bug (I hope so)?

1474
Support / Re: java.security.AccessControlException: access denied
« on: June 17, 2009, 07:19:56 pm »
I can send you the whole thing if you want to have a look. I find it really weird.

1475
Support / Re: java.security.AccessControlException: access denied
« on: June 17, 2009, 07:31:59 am »
I will look into the KeyMapper, thanks.

For my other game, I told you about this already: ever since I switched the renderer from the old hardware method to the AWTGLCanvas, I keep getting ArrayIndexOutOfBoundsExceptions. No event threads either draw or change the models, and all the draw() calls are in a single game loop. So what are all the circumstances in which the World.draw(FrameBuffer) method might throw this right after a succesful call to World.renderScene(FrameBuffer)?

1476
Support / Re: java.security.AccessControlException: access denied
« on: June 17, 2009, 04:05:02 am »
But to address your list of suggestions:
  • I will rescale the textures later (probably the last thing I do, really, because there's so much more to do).
  • I'm not double-loading them, but perhaps the process of loading an image, then making it a texture does that? Your suggestion!
  • Some trees for some reason aren't transparent, but fortunately they're further from camera than the trees that work. I'll look into the problem later, but I looked at the textures and I see nothing wrong with them (same as the ones that work).
  • Only way I see to improve input is to implement lwjgl's keyboard, which I guess I'll do.
  • Are you sure the steering thing isn't your joystick?
  • The cars are a little smaller, but believe it or not that's a choice I made for the gameplay. I don't know, if it bothers people too much, I might rescale them.
  • Good point about the hardware renderer, I will do that.
  • What exactly is MipMapping and how will it improve the game?

Thanks for your suggestions and do read what I wrote in response to your analog stick troubles.

1477
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 10:53:27 pm »
And the joystick uses a button for accelerating and another for braking. as opposed to up and down like the keyboard.

1478
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 10:51:28 pm »
Egon, I fixed the Street Fighter link. As for the joystick spinning the camera, no one in the lwjgl group seems to have a suggestion about it, so at the beginning of Racer I tell you to move the analog sticks before the car moves. I also find that if I press the accelerator button one or two seconds before the race the analog sticks default to zero value (as it always should).

1479
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 09:52:19 pm »
Egon, I really hate showing my stuff to people because I really hate criticism, but here it goes: http://www.agpgames.com

All but the starship game is working to the point of showing it (if maybe not yet bragging!). Check out the racer. And by the way, I didn't do collision between the two cars yet. Thanks a whole lot both to you and to paulscode for the help with the opponent car. Street Fighter was a family joke between me, my wife my brother-in-law and his girlfriend (now wife). I'm still going to add blood and black eyes. All games are meant for an analog joystick, even if they work (badly) with the keyboard.

1480
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 06:17:15 pm »
Thanks for the suggestion, paulscode. Is your way any faster?

And Egon, how fast is it to make something visible/invisble? Because as I understand, I'm going to have to make my object visible, test for collision, then make it invisible before I draw for every iteration. So is it just flipping an internal boolean or does work get done?

1481
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 10:15:26 am »
But it wasn't able until I loaded them through ImageIcon. I can't explain it either. Anyway, as long as it works I am happy. I will post you a link of that racing game you liked soon. At this point I'm just working out the collision-detection. And here's a question: invisibility won't affect collision-detection, will it (I thought once that it did but I hope I'm wrong)?

Oh, and I was going to write that I think the latest version of Firefox changed the way it handles its cache, because all of a sudden I can run, change, recompile, repackage, and run again without it giving me headaches, which is making it much easier on me to test my stuff.

1482
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 08:59:19 am »
That did the trick. So simple! Still, I wish it had worked. What is the purpose of 1.1 compatibility, anyway?

1483
Support / Re: java.security.AccessControlException: access denied
« on: June 16, 2009, 02:37:46 am »
It's neither a typo nor the only way I tried it. This:
Code: [Select]
manager.addTexture("jaguarsk.jpg", new Texture(this.getClass().getResourceAsStream("RacerModels/Textures/jaguarsk.jpg"))); doesn't work either (same security error).

1484
Support / java.security.AccessControlException: access denied
« on: June 16, 2009, 01:11:06 am »
This error is produced by
Code: [Select]
manager.addTexture("jaguarsk.jpg", new Texture(this.getClass().getResource("RacerModels/Textures"), "jaguarsk.jpg")); but not by
Code: [Select]
background = new javax.swing.ImageIcon(this.getClass().getResource("RacerModels/Textures/CLOUDS1.JPG")).getImage();
The same error is true for manager.add(String, new Texture(this.getClass().getResourceAsStream(...)). What gives?

1485
Support / Re: When does ArrayIndexOutOfBoundsException get thrown?
« on: June 11, 2009, 11:38:38 pm »
Actually, I'm beginning to think it's the following method (though the JVM's message doesn't get that far). Note that I left commented-out code that isn't always commented out. Just before the ArrayIndexOutOfBoundsException, "Left drawAxisRep()" doesn't get printed. And yes, it only happens with the hardware renderer:

Code: [Select]
      private void drawAxisRep() {
SimpleVector position = xWing.getTransformedCenter();
SimpleVector xPoint1 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x-8f, position.y, position.z));
SimpleVector xPoint2 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x+8f, position.y, position.z));
SimpleVector yPoint1 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x, position.y-8f, position.z));
SimpleVector yPoint2 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x, position.y+8f, position.z));
SimpleVector zPoint1 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x, position.y, position.z-8f));
SimpleVector zPoint2 = Interact2D.project3D2D(camera, buffer, new SimpleVector(position.x, position.y, position.z+8f));
Graphics2D g = null;
// if (software)
      g = (Graphics2D)buffer.getGraphics();
/* else {
      Drawable drawable = Display.getDrawable();
      if (drawable instanceof AWTGLCanvas)
// g =(Graphics2D) ((AWTGLCanvas)drawable).getGraphics();
g = awtGlCanvas.getGraphics();
}
*/
if (g == null)
      return;
g.setStroke(new BasicStroke(4));
g.translate(300, 200);
g.setColor(Color.red);
g.drawLine((int)xPoint1.x, (int)xPoint1.y, (int)xPoint2.x, (int)xPoint2.y);
g.setColor(Color.green);
g.drawLine((int)yPoint1.x, (int)yPoint1.y, (int)yPoint2.x, (int)yPoint2.y);
g.setColor(Color.blue);
g.drawLine((int)zPoint1.x, (int)zPoint1.y, (int)zPoint2.x, (int)zPoint2.y);
System.out.println("Left drawAxisRep().");
      }

Pages: 1 ... 97 98 [99] 100 101 ... 116