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 ... 95 96 [97] 98 99 ... 116
1441
I've seen it many times myself. It is the actual code, and there are sometimes ascii characters that the text area doesn't interpret as a line which the compiler does. If I remember correctly, the area needs 10 and 26 (break and new line). The compiler probably just interprets 10.

1442
Dos this change your mind?


1443
My lines are out of sync with the compiler's, but a println call on collision reveals my two-ship array to be of length 2 and getTargets() to be of length 1.

1444
I was hoping the answer would be that clear, hahah. Anyway, the texture was being exposed to light but no light was affecting it for some reason. I created a light just for the plane it solved it. Now I'm running into a very weird problem. I'm writing a starship fighting game and originally I tested it with a single enemy ship. I have since changed the single variable to an array of a class names Enemy which holds both the Object3D and handles the ship's behavior (processed in the game loop). It worked fine for a single ship. The odd thing is that now that I have an array of ships (initialized really early on in the constructor), some of the collision tests are still being called for index 0 only (as opposed to a loop testing all the ships) and I'm getting not a NullPointerException but an ArrayIndexOutOfBoundsException on collision(CollisionEvent) when I try to shoot at the ship (or when it's time for it to turn because it hit the sky).

On run():
Code: [Select]
      if (!enemies[0].turning)
enemies[0].tieGuide.checkForCollisionSpherical(enemies[0].translation, 800f);
      if (enemies[0].turning)
enemies[0].turnAround();
      else enemies[0].perform();
On collision(CollisionEvent):
Code: [Select]
if (!enemies[0].turning && e.getSource() == enemies[0].tieGuide && e.getTargets()[0]==worldSphere && System.currentTimeMillis() > enemies[0].lastTurn+1000)
      enemies[0].turnAround();

1445
Yeah, I made it work after tinkering it. Now here's a question about transparency: what exactly does Object3D.setTransparency(100) do? I've been using it in a lot of different programs and objects to erase the black areas in a texture, but I just came across an example where it doesn't work (the area that's supposed to be displayed appears in black while the black areas to disappear). The odd thing about this perfectly conventional texture is that if I don't call setTransparency the entire object comes off as black. And it is being lit. So I guess that's two questions (what does setTransparency do and why is this perfectly conventional texture appear as black). :-)

1446
I used a billboarded plane instead, and I wrote a quick GifTexture class that switches the Texture instance of the object when a next frame method is called. All the Texture instances are pre-initialized and added to the TextureManager, but the plane, most of the time, is rendered without any texture because I don't think jPCT updates the texture references on the fly. Is there an Object3D.update method I'm missing (I've even tried rebuild())? If not, how could I go about doing that (replacing the texture on the fly)?

1447
Actually, I was calling setDepth, if that's what you mean. Sorry I copy it. Anyway, you were right but the result with setNewCoordinates is that I don't see anything.

1448
Support / Draw distance seems to shrink every time I draw an Overlay
« on: July 13, 2009, 08:59:45 pm »
And the Overlay itself doesn't show. The first lines are how I initialized the Overlay, the second are in my collision(CollisionEvent) method.

Code: [Select]
explosionPlane = new Overlay(theWorld, buffer, "explosion2.gif");
explosionPlane.setVisibility(false);

Code: [Select]
explosionPlane.setSourceCoordinates((int)point.x-explosion.getWidth()/2, (int)point.y-explosion.getHeight()/2, (int)(point.x+explosion.getWidth()/2), (int)(point.y+explosion.getHeight()/2));
explosionPlane.setVisibility(true);

1449
News / Re: jPCT goes Android
« on: July 13, 2009, 08:34:41 pm »
Does closing mean they solved it? If so, does it mean we may get an Android version some time soon?

1450
Projects / Re: Animated GIFs
« on: July 09, 2009, 05:14:33 am »
Honestly, I think you should focus your project goals. Do the context stuff first. If you finish that, then worry about teaching it to extrapolate from raw text input. For kicks and giggles (really just to please myself and impress people) I would use JSAPI with a great English recognition engine (you can do that in an afternoon) and then get back to the language context.

1451
Projects / Re: Animated GIFs
« on: July 09, 2009, 12:28:43 am »
It would be, and I've worked on something similar which I have named Lal. Mine, I'm sure, is far behind yours, but it's the same general idea. As far as speech recognition is concerned, are they still making Dragon Naturally Speaking? Up until a few years ago it was by far the best engine around. I know they even based a MacOS program on it (it was originally Windows-only). And I'm sure you know of Cloudgarden, Jonathan Kinnersley's only full JSAPI 1.0 implementation for Windows.

1452
Projects / Re: Animated GIFs
« on: July 08, 2009, 10:37:09 pm »
Thanks a lot, paulscode. I tested it and it works great. I keep meaning to ask you: do you work with AI?

1453
Support / Re: KeyMapper Class
« on: June 23, 2009, 08:27:26 am »
That did it, thank you.

And man, Mizuki just showed me that jPCT off-road car game. Wow, I'm going to have to to try to step up to dmouse's level. Very, very, cool, if you read this, dmouse.

1454
Support / KeyMapper Class
« on: June 22, 2009, 11:44:50 pm »
Egon suggested I used the KeyMapper class to improve keyboard-input-reading for the racing game, and so it is that I am. Problem is, the input is at least as bad as it was before with the following code. The idea is that the car speeds up while you're holding down the UP key and slows down when you're holding DOWN, but in practice it only speeds up and slows down when I press, release, and press again. keyPressed at VK_UP sets speedingUp to true, and at VK_DOWN sets slowingDown to true. Shouldn't the car speed up with every loop iteration? It turns just fine. And I did remove the awt KeyListener, by the way, I'm just using its keyPressed because I'm being lazy.

Code: [Select]
      KeyState state = keyMapper.poll();
      if (state.getState() == KeyState.PRESSED || (speedingUp && state.getKeyCode() == KeyEvent.VK_UP) || (slowingDown && state.getKeyCode() == KeyEvent.VK_DOWN))
keyPressed(new KeyEvent(this, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, state.getKeyCode(), KeyEvent.CHAR_UNDEFINED));

1455
Support / Re: Very Very Simple C Question
« on: June 22, 2009, 07:01:24 pm »
That's what happens when you let your fingers do the typing for you! In the code I did it your way, though.

Pages: 1 ... 95 96 [97] 98 99 ... 116