mmmm
i want add this text
but blizzard.class position from ParentsHouse world to BridgeStoneForest world I also want to add pup1.class & pup2.class, if blizzard.class in BridgeStoneForest World and if blizzard.class is 8 pixels away from pup1.class & pup2.class text appears in the world BridgeStone Forest. after the text is finished pup1.class & pup2.class disappear from the world
I use mat2.class to trigger the switch to the world from ParentsHouse world to BridgeStoneForest world
here the code of mat2.class :
public String dialog2[] = {"Pup 1 & Pup 2 : ''Hello, Alpha. ^^''", "Blizzard : ''Hi, Kiddo. :)", "Pup 1 : ''Alpha, Where are you going?", "Blizzard : ''I'm go to Ancient Dugeons :)", "Pup 2 : ''Woah, Are you sure Alpha? \n That place is very Dangerous,\n My Parent said only Alpha can to there.", "Blizzard : ''Im sure about that :)", "Pup 1 & Pup 2: ''Ok Then Alpha, Good luck.''", "Blizzard : ''Thank you, Kindos. See ya ;)''", "Pup 1 & Pup 2 : ''Your Welcome, Alpha, see yaa!!!''" };
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Mat2 here. * * @author (your name) * @version (a version number or a date) */ public class Mat2 extends Mats { /** * Act - do whatever the Mat2 wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { Touching(); } public void Touching() {if (isTouching(Blizzard.class)) { if (getWorld() instanceof ParentsHome) { World bsf = new BridgeStoneForest(); getWorld().repaint(); bsf.removeObjects(bsf.getObjects(Dialogue.class)); bsf.removeObjects(bsf.getObjects(Blizzard.class)); bsf.addObject(new Blizzard(), 723,111); ((ParentsHome)getWorld()).Back.stop(); Greenfoot.setWorld(bsf); } } } }