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

    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 online now Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    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).

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

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

    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
    Rep Power

    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 06: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, 08: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, 06:32 PM
  5. Problem deleting ball from bouncing ball app
    By adlb1300 in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 10: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