This site requires JavaScript, please enable it in your browser!
Greenfoot back
seut22
seut22 wrote ...

2014/5/9

Hello can someone explain whats wrong here? :3

seut22 seut22

2014/5/9

#
i have two winnerstate, baby win and gun win. my winnerstate is to show one image when gun wins and another image when baby wins. i have two problems first problem: when i reach my winnerstate both images shows second problem: the position of the image follows the opbect so if the gun is in a screw position my images is also in a screw position underneath is my code hope someone can help. import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Bullet here. * * @author (your name) * @version (a version number or a date) */ public class Bullet extends Animal { private GreenfootImage image25; public Bullet() { image25 = new GreenfootImage("Gunwon.png"); } /** * Act - do whatever the Bullet wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(20); Remove(); } public void Remove() { if (canSee(VIRUS.class)) { eat(VIRUS.class); Greenfoot.playSound("slurp.wav"); setImage(image25); setLocation(500,400); Greenfoot.stop(); } } }
davmac davmac

2014/5/9

#
You need to login to post a reply.