Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sprite controll help  RSS feed

 
Evan Pierce
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
noone?
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!