Results 1 to 4 of 4
  1. #1
    nisael is offline Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Default how to make a curve motion with ball object

    i want to make a simply game,actualy not a game but i want to moving object curve just like angry bird.
    where i can move an object with curve motion.
    but i dont know how.
    i just can make it move straight(left,right,down,up).
    please help

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,388
    Rep Power
    5

    Default Re: how to make a curve motion with ball object

    A curve is nothing more than a series of x,y coordinates. So if f(x) is your curve equation then y = f(x) provides the two points.

    To start off simple, use y = mx + b for a straight line. By varying the sign and value of the slope (m) and the y intercept(b) you can draw a diagonal line. If you want to move the object from upper left corner to lower right corner of a square, use y = x, where the slope would be 45 degrees (or m = 1).

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    177
    Rep Power
    2

    Default Re: how to make a curve motion with ball object

    to curve like a projectile being thrown you just subtract from the y each time and it will curve
    With the right know how, anything is possible

  4. #4
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Posts
    100
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    take a look at my program called "enemyShip" under the java programming education section of my website displayed under my signature. it uses the same functionality that you are talking about, already written. but you would have to poke around a bit.

    here is the link:
    Enemy ship
    Last edited by natdizzle; 01-19-2014 at 05:09 AM. Reason: link added

Similar Threads

  1. Make an object from a class once
    By OddOne in forum New To Java
    Replies: 7
    Last Post: 07-03-2012, 05:04 PM
  2. Freehand curve smoothing using Bezier Curve
    By JavaIsChallenging in forum Java 2D
    Replies: 3
    Last Post: 12-14-2011, 07:56 PM
  3. How to make a MouseClick paint an object
    By Devilsfutbol17 in forum New To Java
    Replies: 6
    Last Post: 06-05-2008, 12:54 PM
  4. How do I make My ball to move randomly?
    By whdbstjr90 in forum New To Java
    Replies: 4
    Last Post: 12-31-2007, 05:32 PM
  5. Problem deleting ball from bouncing ball app
    By adlb1300 in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 09:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •