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

2012/3/16

compiling problems

danbhome danbhome

2012/3/16

#
when i try to make my bannanna shoot a bullet, it says constructor bullet cannot be applied to given types; required: no arguments found: bannanaofdeath reason: actual and formal argument lists differ in length import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class bannanaofdeath here. * * @author (your name) * @version (a version number or a date) */ public class bannanaofdeath extends you { /** * Act - do whatever the bannanaofdeath wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. i am making a gun, aka, bannana of death,shoot a bullet,but i have a compiling problem where it says this construct in class bullet cannot be applied to given types; required: no arguments found: bannanaofdeath reason:actual and formal argument lists differ in length this is my bannanaofdeath.class */ public void act() { if (Greenfoot.isKeyDown("space")) { getWorld().addObject(new bullet(this), getX(), getY()); } } }
Builderboy2005 Builderboy2005

2012/3/16

#
What does the constructor for bullet look like? What influenced you to put 'this' as an argument for bullet?
danbhome danbhome

2012/3/16

#
sorry i fixed it before i noticed your comment. if i have more problems i will post them here but most likely they will be on a different game sorry for the problems. also if any others have a compiling problem feel free to post them here.
danbhome danbhome

2012/3/16

#
ok i have another problem. i have it to where when frownyface=null it makes a chomp sound, but once they are all dead it does infinate chomps. any way to fix that?
danbhome danbhome

2012/3/16

#
btw for first error i based it off tut access p2 and a little of nightmare: emergence
You need to login to post a reply.