aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes problem in movement logic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem in movement logic" Watch "problem in movement logic" New topic
Author

problem in movement logic

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 938
Sorry if i am posting this in wrong thread.


code is working, but there is some problem in my movementFish function, i tried allot but don't know where the problem is.
the problem is:
my x and y positions are 90 and 50,
sp.getHeight is 280 and sp.getWidth is 480.

when my image reached to 480 it reversed but now after reversing when it comes back(moving) to it's 0(zero)th position my y direction not changing while it's moving, it's moving continually at the top of frame, i mean to say, while coming back to 0th after reaching to 480, it only moving from left to right not top to bottom also (i mean y is not working only x is working).??
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
probably best to keep it all in the one thread, saves duplication of responses

http://www.coderanch.com/t/568233/GUI/java/reverse-image
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 938
sorry for that...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
No need to be sorry, posting a new topic
for a new problem is the right way to go.

A topic with 0 replies will get more attention
than a topic with 20+ replies.

The problem was resurrecting the old topic
at the same time, making this new topic redundant.

All you needed to do, in this new topic,
was to include a link to the old topic and
there would have been a natural flow.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 938
okay...
Thanks for the suggestions..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in movement logic
 
Similar Threads
how to give animation to images?
problem in setting background image of jpanel
problem in creating more than one objects
Problem in passing color as a parameter
how to reverse an image?