Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

problem in movement logic

 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).??
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
probably best to keep it all in the one thread, saves duplication of responses

https://coderanch.com/t/568233/GUI/java/reverse-image
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for that...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay...
Thanks for the suggestions..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic