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

Kogeid's Comments

Back to Kogeid's profile

That's for spawning, and to fall, you can make 3methods in each class whose instance will fall, i named mines as "fall()" , "checkFall()" and "onGround()": public void fall() { setLocation(getX(), getY() + vSpeed); if(vSpeed <=9) { vSpeed = vSpeed + acceleration; } jumping = true; } public void checkFall() { if(onGround()) { vSpeed = 0; } else { fall(); } } public boolean onGround() { int spriteHeight = getImage().getHeight(); int yDistance = (int)(spriteHeight/2) + 5; Actor ground = getOneObjectAtOffset(0, getImage().getHeight()/2, brick1.class); if(ground == null) { jumping = true; return false; } else { moveToGround(ground); return true; } } where "vspeed" is the vertical speed, as you could call it, gravity, therefore, is't location will change at "vspeed" ratio., if it's not on the ground and if it's on the ground, the vertical speed will be 0. I hope i could help you c:
Thanks guys :D hihahaan, if you're refering to the golden balls, i made the instance of the class prince to create them uder a pattern, it had to be in certain tipe of coordinate, far from edge, and not under prince instance, also, x value less than 200, for the balls to be at range to collect.... if it's not enough, please show the part of the code you're having trouble with, and a description of what it does, and i'll check it out as soon as i can :D
Hey dude, i found a bug and i have a suggestion.... First, in the exits of each level, there's a greenfoot icon, for graphic display it would be better to put an arrow or something, or just nothing, not sure if is just in progress, also, if you dodge that icon, and just go to the exit, without touching it, you don't pass, so something to fix too... And the bug... if you click anywhere in the map exactly when the question is displayed, instead of clicking in "Aceptar", the program colapses. Be sure to check it out.
Hey bro, i think you have a problem with the sounds, one click to shoot, and a huge lot of shooting sounds... Don't know if it's intended, but if not, be sure to check it out.