i need some help with the SlowMovevertical method, i dont know how to incorparate it correctly into my source code to make it work?
thanks if you can help.

Recommended Answers

All 7 Replies

It's a method, methods belong to objects of certain types. What is the type here? I want to help, but the name 'SlowMoveVertical' is a normal looking name that a lot of people already have used to create their own methods. Therefor, a google search isn't getting me anywhere unless I know with which type of objects this method is used.

Black Box

so hows about i send you my source code and then you may find it easier to work out? i nknow it sounds like im getting you to do the work, but its the best way i can think of.if you do complete it could you inform me on what you done and why/
cheers chris

What problem are you facing? why do not you post the code here ?

[QUOTE=ithelp;484514]What problem are you facing? why do not you post the code here ?[/QUOTE]

public class Balloons
{
    private Circle balloon;
    private Triangle bottom;
    private Triangle end;
    private Circle balloon2;
    private Triangle bottom2;
    private Triangle end2;
    private Circle balloon3;
    private Triangle bottom3;
    private Triangle end3;
    private slowMoveVertical balloon;

    /**
     * construct object
     */
    public void draw()
    {
        balloon = new Circle();
        balloon.changeColor("red");
        balloon.moveHorizontal(8);
        balloon.moveVertical(121);
        balloon.changeSize(60);
        balloon.makeVisible();

        bottom = new Triangle();  
        bottom.changeColor("green");
        bottom.changeSize(-38, 55);
        bottom.moveHorizontal(8);
        bottom.moveVertical(247);
        bottom.makeVisible();

        end = new Triangle();  
        end.changeColor("blue");
        end.changeSize(7, 11);
        end.moveHorizontal(8);
        end.moveVertical(246);
        end.makeVisible();

        balloon2 = new Circle();
        balloon2.changeColor("blue");
        balloon2.moveHorizontal(125);
        balloon2.moveVertical(175);
        balloon2.changeSize(60);
        balloon2.makeVisible();

        bottom2 = new Triangle();  
        bottom2.changeColor("magenta");
        bottom2.changeSize(-38, 55);
        bottom2.moveHorizontal(125);
        bottom2.moveVertical(301);
        bottom2.makeVisible();

        end2 = new Triangle();  
        end2.changeColor("green");
        end2.changeSize(7, 11);
        end2.moveHorizontal(125);
        end2.moveVertical(300);
        end2.makeVisible();


        balloon3 = new Circle();
        balloon3.changeColor("yellow");
        balloon3.moveHorizontal(240);
        balloon3.moveVertical(141);
        balloon3.changeSize(60);
        balloon3.makeVisible();

        bottom3 = new Triangle();  
        bottom3.changeColor("blue");
        bottom3.changeSize(-38, 55);
        bottom3.moveHorizontal(240);
        bottom3.moveVertical(267);
        bottom3.makeVisible();

        end3 = new Triangle();  
        end3.changeColor("black");
        end3.changeSize(7, 11);
        end3.moveHorizontal(240);
        end3.moveVertical(266);
        end3.makeVisible();

    }    
        /**
         * Create method for balloons to fly
         */

         public void slowMoveVertical(int distance)
    {
        slowMoveVertical.balloon();

    }
}

Erm, that method does not do anything at all and this declaration doesn't really make any sense

private slowMoveVertical balloon;

Your slowMoveVertical() needs to move all of the drawn objects up by a certain distance.

lol i know it doesnt make sense because i was still working on it. but what im asking is what to write next

I told you in my post above. The slowMoveVertical() method needs to move all of the object up by "distance" and I would assume from the name that it should occur incrementally as a timed paint operation.

You may want to read through this tutorial article on animation in applets:
http://www.javaworld.com/javaworld/jw-03-1996/jw-03-animation.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.