Hello!
I'm constructing a classic platform-game for a school-assignment and I want the attributes of my objects to change when they touch certain stuff in the world.
At this moment i want the player to touch one thing and this will set the transparency of certain blocks to 255 and also make them "physical" meaning that the player can jump on to the blocks and move ahead from there.
i was trying things like :
which made greenfoot really upset (which probably is understandable.. but not to me really ^.^)
again, in short : When the player runs on to (touches) an object in the world, this will change the attributes and transparency of a third object.
Thanks in advance!
GreenBrick greenBrick = (GreenBrick)getOneIntersectingObject(GreenBrick.class); Girl girl = (Girl)getOneIntersectingObject(Girl.class); if(girl != null) { greenBrick.getImage().setTransparency(255); }