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

2017/2/6

Shift-Clicking Problem?

aldrisang aldrisang

2017/2/6

#
Did something change in the newer versions of Greenfoot? When I shift+click to put several turtles into the world for Trick the Turtle, as I'm following the JoC #4 video (and have the turtle moving and/or turning), those turtles don't get that custom act() block. The only turtles that do are the ones that I create the normal way, which means one at a time..
Super_Hippo Super_Hippo

2017/2/6

#
I just tried it: (version 3.1.0)
import greenfoot.*;

public class MyWorld extends World
{
    public MyWorld()
    {    
        super(600, 400, 1); 
    }
}
import greenfoot.*;

public class Turtle extends Actor
{
    public void act() 
    {
        move(1);
    }    
}
When I pause the scenario (or before it started), and add Turtles (without image, so just green foots) into the world and then continue the execution of the scenario, all green foots move to the right side until they reach the end. So I can't confirm your problem. Maybe you can try my short code in a new Scenario and if get the same results as me, try to find what could cause the problem in your scenario.
aldrisang aldrisang

2017/2/14

#
I'm not sure what happened, but it does work now. I'm up to JoC #20, where it's still being taught to use java.awt.Color, which actually doesn't work anymore, but I figured that one out with Google. :) Just wish I could let Michael Kolling know his videos need a disclaimer, lol. EDIT: Turns out Michael Kolling actually reads this forum, and he'll do what he can to update his blog and/or videos. Yay.
You need to login to post a reply.