Greenfoot greeps scenario12/3/2023 ![]() You do have only one lives and one money counter - but, you are creating a healthbar for each greep spawned. One of each is needed for each Greeps object if they are to have their own values for these states.Sorry - I was not thinking clear (or did not see the whole picture). I ask these questions because you currently have only ONE healthbar and ONE lives counter and ONE money counter created in the world. (2) Are each Greeps object (regardless of subclass created from) to have a healthbar and a lives counter and a money counter? (1) How many of each subclass of Greeps will you be creating? Hb.fillRect(1,1,health*healthPerPixel,height) ĭanpost wrote.Let me ask you a few questions, here. SetImage(new GreenfootImage(width+2,height+2)) * Write a description of class HealthBar here. ![]() GetWorld().addObject(new MainMenuButton(),300,225) Int theDistance = (int)(Math.hypot(WayX - getX(), WayY - getY())) * Sets the speed of the Greeps and determins when to move onto the next waypoint Heavy heavy = new Heavy(level,lives,healthbar) ĪddObject(new HealthBar(),heavy.getX(),heavy.getY()) Medium medium = new Medium(level,lives, healthbar) ĪddObject(new HealthBar(),medium.getX(),medium.getY()) Small small = new Small(level,lives,healthbar) ĪddObject(new HealthBar(),small.getX(),small.getY()) ![]() Create a new world with 600x425 cells with a cell size of 2x2 pixels. * Constructor for objects of class Stage1. * Write a description of class Stage1 here. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |