File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes sprite controll help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Game Development
Reply Bookmark "sprite controll help" Watch "sprite controll help" New topic
Author

sprite controll help

Evan Pierce
Ranch Hand

Joined: Jan 31, 2006
Posts: 36
hey, im trying to make something in my game so that when a user clicks a sprite it becomes in a state of 'activity' and only 1 sprite can be in it at a time. now when a sprite is in 'activity' i want it so when the mouse gets a certaint amount of distance away from the sprite it will send the sprite off in that direction.

now what ive done so far is made a collision detection for when the mouse is over the sprite & clicked which triggers a method in one of the sprites if they collide. this method checks to see if left click was released then send it off in direction of mouse. my problem is that this doesnt seem to be working, i think whats happening is that it all works untill the if left click is released, inwhich my mouse is no longer over the sprite and the sprite just sits there then when i move my mouse back over it, it flys off in the direction it should have.

anyone have an ideas? maybe i should be going about this in a tottally diffrent manner. thanks in advance.
Evan Pierce
Ranch Hand

Joined: Jan 31, 2006
Posts: 36
noone?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Patience, young grasshopper.

I am not sure what the problem is. Perhaps it will help if you can post some code snippets to illustrate what you are doing. The verbal explanation helps us understand what you mean to do, but the code will show us what you are actually doing.

Layne


Java API Documentation
The Java Tutorial
 
IntelliJ Java IDE
 
subject: sprite controll help
 
Threads others viewed
design help
Listener, Component, Interface
Listener, Component, Interface
angle of mouse
I'm having trouble with my game...
MyEclipse, The Clear Choice