What I do that helps a ton when working through a project, and that is to use MindMaps, or a flow chart. You can do most anything in programming if you just think about what it is you're wanting to do, then look for the code that fits the actions you need to be taken. PaddleSize = 15 // This example can either be a variable that keeps track, or a method. PaddleSize = 10 // This example can either be a variable that keeps track, or a method. PaddleSize = 5 // This example can either be a variable that keeps track, or a method. GreenfootImage image = new GreenfootImage(width,height) * this method again when the width, height, or color change. * Method to create and set the image for this paddle. * Act - a paddle will move in reaction to a left or right Public Paddle(int theWidth, int theHeight, * theAmount the number of cells (pixels) to move * Constructor that takes the width, height, color, and moveAmount * A paddle is a rectangular object that can be moved via the left Import greenfoot.* // (World, Actor, GreenfootImage, and Greenfoot) World.addObject(new BallX(), getWorld().getWidth(), getWorld().getHeight()) If(getY() + radius >= BreakoutWorld.HEIGHT)īreakoutWorld world = (BreakoutWorld) getWorld() * the 'Act' or 'Run' button gets pressed in the environment.Īctor paddle = getOneIntersectingObject(Paddle.class) * Act - do whatever the PowerUp wants to do. * Write a description of class PowerUp here. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |