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

2019/7/19

User writing and making the character move

1
2
Scarley Scarley

2019/7/19

#
So i made a game that works pretty fine, i can move around, if i get to the castle the level finishes, just a simple labyrinth game, but i wanted to make so, the user could write and move the character instead of pressing arrows keys, like he could actually move with commands, is there anyway for me to do that? im really lost and i really wanted this to work, but i dont know where to go or how to do it.
danpost danpost

2019/7/19

#
Please give examples of what the user may write.
Scarley Scarley

2019/7/19

#
Something like hero_moveleft(); is what i was aiming for
danpost danpost

2019/7/19

#
I guess you could use an act method in your world class to prompt for commands with the Greenfoot.ask method::
public void act()
{
    String command = Greenfoot.ask("Enter command");
    if ("stop();".equals(command)) Greenfoot.stop();
    else if ("hero_moveleft();".equals(command)) hero.setLocation(hero.getX()-1, hero.getY());
    else // etc.
}
It would make for a pretty slow game, however. What would be the purpose of having the commands written out as such?
Scarley Scarley

2019/7/19

#
i dont mind being a pretty slow game, the main idea is just to make something like one of those really old games where u had to write to move your character, i remember playing on my first pc, so i just though would be fun making one So just using this on my world class should work? sorry if i sound kind dumb, im still learning how to use it
danpost danpost

2019/7/19

#
Scarley wrote...
So just using this on my world class should work?
Best thing to do is try it out. See what happens. You learn faster by testing yourself.
Scarley Scarley

2019/7/19

#
I tried it out but im getting this error http://prntscr.com/ohgmq0 ( My actor is called Player and not hero so i changed http://prntscr.com/ohgn16)
danpost danpost

2019/7/19

#
In your world class, add the following field:
private Player player;
Then, in your prepare method, remove the first word, "Player", from the line:
Player player = new Player();
Now, use "player" instead of Player in the setLocation line.
Scarley Scarley

2019/7/19

#
public class MyWorld extends greenfoot.World
{
    int time = 0;
    /**
     * Constructor for objects of class MyWorld.
     */
    public MyWorld()
    {
      
        super(800, 600, 1);
        prepare();
    }
    public void act(){
         private Player player;
         Player player = new Player();
        time++;
        if(time % 480 == 0){
            addObject(new Enemy(), Greenfoot.getRandomNumber(800), Greenfoot.getRandomNumber(600));
        }
        String command = Greenfoot.ask("Enter command");
        if ("stop();".equals(command)) Greenfoot.stop();
        else if ("hero_moveleft();".equals(command)) player.setLocation(player.getX()-1, player.getY());
        else if ("hero_moveright);".equals(command)) player.setLocation(player.getX()+1, player.getY());
        else if ("hero_moveup();".equals(command)) player.setLocation(player.getX(), player.getY()+1);
        else if ("hero_moveleft();".equals(command)) player.setLocation(player.getX(), player.getY()-1);
    }
Something like this? still says illegal start of expression on "private Player player;"
danpost danpost

2019/7/19

#
You want a field -- not just a variable. Move line 14 to around 4. Remove line 15. There might also be an issue in your prepare method which you have not shown.
Scarley Scarley

2019/7/20

#
I dont have any errors on the code anymore thank you very much, but now i got this weird one http://prntscr.com/ohj3zw, everytime i try typing the command this shows up
danpost danpost

2019/7/20

#
Scarley wrote...
I dont have any errors on the code anymore thank you very much, but now i got this weird one http://prntscr.com/ohj3zw, everytime i try typing the command this shows up
You will need to show your entire MyWorld class codes (including import lines).
Scarley Scarley

2019/7/22

#
This is my entire MyWorld Class, sorry for the late reply...
import lang.stride.*;
import java.util.*;
import greenfoot.*;

/**
 * 
 */
public class MyWorld extends greenfoot.World
{
    int time = 0;
    private Player player;
    /**
     * Constructor for objects of class MyWorld.
     */
    public MyWorld()
    {   super(800, 600, 1);
        prepare();
    }
    public void act(){

        time++;
        if(time % 480 == 0){
            addObject(new Enemy(), Greenfoot.getRandomNumber(800), Greenfoot.getRandomNumber(600));
        }
        String command = Greenfoot.ask("Enter command");
        if ("stop();".equals(command)) Greenfoot.stop();
        else if ("hero_moveleft();".equals(command)) player.setLocation(player.getX()-1, player.getY());
        else if ("hero_moveright();".equals(command)) player.setLocation(player.getX()+1, player.getY());
        else if ("hero_moveup();".equals(command)) player.setLocation(player.getX(), player.getY()+1);
        else if ("hero_moveleft();".equals(command)) player.setLocation(player.getX(), player.getY()-1);
    }
    /**
     * Prepare the world for the start of the program.
     * That is: create the initial objects and add them to the world.
     */
    private void prepare()
    {
        Enemy enemy = new Enemy();
        addObject(enemy,Greenfoot.getRandomNumber(800) , Greenfoot.getRandomNumber(600));
        Enemy enemy2 = new Enemy();
        addObject(enemy2,Greenfoot.getRandomNumber(800) , Greenfoot.getRandomNumber(600));
        Enemy enemy3 = new Enemy();
        addObject(enemy2,Greenfoot.getRandomNumber(800) , Greenfoot.getRandomNumber(600));
        Enemy enemy4 = new Enemy();
        addObject(enemy4,Greenfoot.getRandomNumber(800) , Greenfoot.getRandomNumber(600));
        WallWidthLong wallWidthLong = new WallWidthLong();
        addObject(wallWidthLong,256,549);
        WallWidthLong wallWidthLong2 = new WallWidthLong();
        addObject(wallWidthLong2,358,543);
        wallWidthLong2.setLocation(384,537);
        WallWidthLong wallWidthLong3 = new WallWidthLong();
        addObject(wallWidthLong3,602,539);

        wallWidthLong3.setLocation(579,538);
        WallWidthLong wallWidthLong4 = new WallWidthLong();
        addObject(wallWidthLong4,90,597);
        WallWidthLong wallWidthLong5 = new WallWidthLong();
        addObject(wallWidthLong5,364,595);

        wallWidthLong5.setLocation(392,595);
        WallWidthLong wallWidthLong6 = new WallWidthLong();
        addObject(wallWidthLong6,639,592);
        wallWidthLong6.setLocation(652,597);
        WallWidthLong wallWidthLong7 = new WallWidthLong();
        addObject(wallWidthLong7,156,3);
        wallWidthLong7.setLocation(144,5);
        WallWidthLong wallWidthLong8 = new WallWidthLong();
        addObject(wallWidthLong8,456,3);
        wallWidthLong8.setLocation(452,9);
        WallWidthLong wallWidthLong9 = new WallWidthLong();
        addObject(wallWidthLong9,682,9);
        wallWidthLong9.setLocation(677,-4);
        wallWidthLong9.setLocation(688,5);
        WallWidthLong wallWidthLong10 = new WallWidthLong();
        addObject(wallWidthLong10,372,115);
        wallWidthLong10.setLocation(426,123);
        WallWidthMedium wallWidthMedium = new WallWidthMedium();
        addObject(wallWidthMedium,233,114);
        wallWidthMedium.setLocation(229,118);
        WallWidthLong wallWidthLong11 = new WallWidthLong();
        addObject(wallWidthLong11,474,179);
        wallWidthLong11.setLocation(492,181);
        WallWidthMedium wallWidthMedium2 = new WallWidthMedium();
        addObject(wallWidthMedium2,320,183);
        wallWidthMedium2.setLocation(304,179);
        WallHeightSmall wallHeightSmall = new WallHeightSmall();
        addObject(wallHeightSmall,236,199);
        wallHeightSmall.setLocation(239,212);
        WallWidthMedium wallWidthMedium3 = new WallWidthMedium();
        addObject(wallWidthMedium3,376,407);
        wallWidthMedium3.setLocation(405,412);
        WallWidthLong wallWidthLong12 = new WallWidthLong();
        addObject(wallWidthLong12,272,415);
        wallWidthLong12.setLocation(308,413);
        WallWidthLong wallWidthLong13 = new WallWidthLong();
        addObject(wallWidthLong13,432,241);
        wallWidthLong13.setLocation(414,477);
        wallWidthLong13.setLocation(282,477);
        WallWidthSmall wallWidthSmall = new WallWidthSmall();
        addObject(wallWidthSmall,282,477);
        wallWidthLong13.setLocation(282,477);
        WallHeightMedium wallHeightMedium = new WallHeightMedium();
        addObject(wallHeightMedium,718,123);
        wallHeightMedium.setLocation(718,151);
        WallHeightMedium wallHeightMedium2 = new WallHeightMedium();
        addObject(wallHeightMedium2,714,277);
        wallHeightMedium2.setLocation(720,331);
        WallHeightMedium wallHeightMedium3 = new WallHeightMedium();
        addObject(wallHeightMedium3,630,195);
        wallHeightMedium3.setLocation(638,235);
        WallHeightMedium wallHeightMedium4 = new WallHeightMedium();
        addObject(wallHeightMedium4,640,359);
        wallHeightMedium4.setLocation(638,371);
        WallHeightMedium wallHeightMedium5 = new WallHeightMedium();
        addObject(wallHeightMedium5,639,476);
        wallHeightMedium5.setLocation(638,455);
        WallHeightMedium wallHeightMedium6 = new WallHeightMedium();
        addObject(wallHeightMedium6,556,347);
        wallHeightMedium6.setLocation(560,381);
        WallHeightSmall wallHeightSmall2 = new WallHeightSmall();
        addObject(wallHeightSmall2,556,277);
        wallHeightSmall2.setLocation(559,268);
        WallHeightSmall wallHeightSmall3 = new WallHeightSmall();
        addObject(wallHeightSmall3,400,261);
        wallHeightSmall3.setLocation(397,270);
        WallHeightSmall wallHeightSmall4 = new WallHeightSmall();
        addObject(wallHeightSmall4,400,301);
        wallHeightSmall4.setLocation(398,327);
        WallHeightSmall wallHeightSmall5 = new WallHeightSmall();
        addObject(wallHeightSmall5,474,379);
        wallHeightSmall5.setLocation(478,379);
        WallHeightSmall wallHeightSmall6 = new WallHeightSmall();
        addObject(wallHeightSmall6,478,321);
        wallHeightSmall6.setLocation(479,330);
        WallWidthSmall wallWidthSmall2 = new WallWidthSmall();
        addObject(wallWidthSmall2,362,241);
        wallWidthSmall2.setLocation(358,241);
        WallWidthMedium wallWidthMedium4 = new WallWidthMedium();
        addObject(wallWidthMedium4,490,239);
        wallWidthMedium4.setLocation(472,243);
        wallWidthMedium4.setLocation(530,241);
        WallWidthSmall wallWidthSmall3 = new WallWidthSmall();
        addObject(wallWidthSmall3,530,241);
        wallWidthMedium4.setLocation(518,243);
        WallHeightSmall wallHeightSmall7 = new WallHeightSmall();
        addObject(wallHeightSmall7,322,269);
        wallHeightSmall7.setLocation(318,273);
        WallWidthSmall wallWidthSmall4 = new WallWidthSmall();
        addObject(wallWidthSmall4,363,356);
        wallWidthSmall4.setLocation(358,357);
        WallHeightMedium wallHeightMedium7 = new WallHeightMedium();
        addObject(wallHeightMedium7,162,185);
        wallHeightMedium7.setLocation(160,207);
        WallHeightSmall wallHeightSmall8 = new WallHeightSmall();
        addObject(wallHeightSmall8,160,315);
        wallHeightSmall8.setLocation(160,325);
        WallHeightMedium wallHeightMedium8 = new WallHeightMedium();
        addObject(wallHeightMedium8,80,175);
        wallHeightMedium8.setLocation(81,152);
        WallHeightMedium wallHeightMedium9 = new WallHeightMedium();
        addObject(wallHeightMedium9,80,303);
        wallHeightMedium9.setLocation(80,331);
        WallHeightSmall wallHeightSmall9 = new WallHeightSmall();
        addObject(wallHeightSmall9,70,445);
        wallHeightSmall9.setLocation(80,449);
        WallHeightSmall wallHeightSmall10 = new WallHeightSmall();
        addObject(wallHeightSmall10,158,457);
        wallHeightSmall10.setLocation(160,439);
        WallHeightSmall wallHeightSmall11 = new WallHeightSmall();
        addObject(wallHeightSmall11,157,500);
        wallHeightSmall11.setLocation(160,497);
        WallHeightSmall wallHeightSmall12 = new WallHeightSmall();
        addObject(wallHeightSmall12,160,531);
        wallHeightSmall12.setLocation(162,517);
        WallHeightMedium wallHeightMedium10 = new WallHeightMedium();
        addObject(wallHeightMedium10,2,483);
        wallHeightMedium10.setLocation(-1,516);
        wallHeightMedium10.setLocation(1,532);
        WallHeightMedium wallHeightMedium11 = new WallHeightMedium();
        addObject(wallHeightMedium11,2,365);
        wallHeightMedium11.setLocation(1,330);
        WallHeightMedium wallHeightMedium12 = new WallHeightMedium();
        addObject(wallHeightMedium12,798,261);
        wallHeightMedium12.setLocation(807,236);
        wallHeightMedium12.setLocation(798,195);
        wallHeightMedium12.setLocation(796,193);
        wallHeightMedium12.setLocation(801,156);
        wallHeightMedium12.setLocation(798,127);
        WallHeightMedium wallHeightMedium13 = new WallHeightMedium();
        addObject(wallHeightMedium13,796,405);
        wallHeightMedium13.setLocation(801,380);
        wallHeightMedium13.setLocation(798,347);
        wallHeightMedium13.setLocation(803,340);
        WallHeightMedium wallHeightMedium14 = new WallHeightMedium();
        addObject(wallHeightMedium14,794,504);
        wallHeightMedium14.setLocation(798,506);
        WallWidthSmall wallWidthSmall5 = new WallWidthSmall();
        addObject(wallWidthSmall5,678,478);
        WallWidthSmall wallWidthSmall6 = new WallWidthSmall();
        addObject(wallWidthSmall6,676,120);
        WallWidthMedium wallWidthMedium5 = new WallWidthMedium();
        addObject(wallWidthMedium5,552,62);
        wallWidthMedium5.setLocation(567,63);
        wallWidthMedium5.setLocation(504,62);
        WallWidthSmall wallWidthSmall7 = new WallWidthSmall();
        addObject(wallWidthSmall7,504,62);
        wallWidthMedium5.setLocation(520,62);
        WallHeightSmall wallHeightSmall13 = new WallHeightSmall();
        addObject(wallHeightSmall13,564,82);
        wallHeightSmall13.setLocation(559,87);
        WallHeightSmall wallHeightSmall14 = new WallHeightSmall();
        addObject(wallHeightSmall14,779,49);
        wallHeightSmall14.setLocation(798,36);
        WallHeightSmall wallHeightSmall15 = new WallHeightSmall();
        addObject(wallHeightSmall15,400,42);
        wallHeightSmall15.setLocation(398,28);
        WallHeightMedium wallHeightMedium15 = new WallHeightMedium();
        addObject(wallHeightMedium15,16,106);
        wallHeightMedium15.setLocation(0,88);
        WallWidthSmall wallWidthSmall8 = new WallWidthSmall();
        addObject(wallWidthSmall8,130,64);
        wallWidthSmall8.setLocation(119,65);
        WallWidthSmall wallWidthSmall9 = new WallWidthSmall();
        addObject(wallWidthSmall9,269,299);
        wallWidthSmall9.setLocation(282,296);
        WallHeightSmall wallHeightSmall16 = new WallHeightSmall();
        addObject(wallHeightSmall16,237,381);
        wallHeightSmall16.setLocation(242,380);
        WallHeightSmall wallHeightSmall17 = new WallHeightSmall();
        addObject(wallHeightSmall17,238,310);
        wallHeightSmall17.setLocation(242,330);
        WallHeightSmall wallHeightSmall18 = new WallHeightSmall();
        addObject(wallHeightSmall18,236,78);
        wallHeightSmall18.setLocation(239,85);
        wallHeightSmall18.setLocation(244,86);
        wallHeightSmall18.setLocation(242,86);
        WallHeightSmall wallHeightSmall19 = new WallHeightSmall();
        addObject(wallHeightSmall19,251,27);
        wallHeightSmall19.setLocation(244,38);
        WallWidthSmall wallWidthSmall10 = new WallWidthSmall();
        addObject(wallWidthSmall10,330,56);
        wallWidthSmall10.setLocation(370,62);
        WallWidthSmall wallWidthSmall11 = new WallWidthSmall();
        addObject(wallWidthSmall11,40,244);
        wallWidthSmall11.setLocation(38,244);
        WallWidthMedium wallWidthMedium6 = new WallWidthMedium();
        addObject(wallWidthMedium6,498,478);
        wallWidthMedium6.setLocation(492,478);
        WallWidthSmall wallWidthSmall12 = new WallWidthSmall();
        addObject(wallWidthSmall12,644,134);
        wallWidthSmall12.setLocation(590,58);
        WallWidthSmall wallWidthSmall13 = new WallWidthSmall();
        addObject(wallWidthSmall13,424,244);
        wallWidthSmall13.setLocation(407,241);
        WallHeightSmall wallHeightSmall20 = new WallHeightSmall();
        addObject(wallHeightSmall20,632,140);
        wallHeightSmall20.setLocation(640,140);
        WallHeightSmall wallHeightSmall21 = new WallHeightSmall();
        addObject(wallHeightSmall21,790,226);
        wallHeightSmall21.setLocation(801,233);
        wallHeightSmall21.setLocation(798,244);
        wallHeightSmall21.setLocation(795,243);
        Player player = new Player();
        addObject(player,46,203);
        player.setLocation(38,205);
        player.setLocation(38,205);
        wallHeightSmall.setLocation(240,266);
        wallWidthSmall4.setLocation(301,357);
        wallWidthLong13.setLocation(181,477);
        wallHeightSmall.setLocation(235,208);
        wallWidthMedium2.setLocation(270,179);
        wallHeightSmall.setLocation(240,195);
        wallWidthSmall4.setLocation(371,360);
        wallWidthLong8.setLocation(326,9);
        wallWidthSmall10.setLocation(343,58);
        wallWidthSmall12.setLocation(602,57);
        wallWidthSmall6.setLocation(667,120);
        wallWidthSmall4.setLocation(374,359);
        wallWidthLong2.setLocation(342,541);
        wallWidthLong.setLocation(190,535);
        wallWidthLong13.setLocation(367,484);
        wallWidthLong.setLocation(58,541);
        wallWidthLong.setLocation(51,538);
        wallWidthSmall4.setLocation(353,364);
        wallWidthSmall4.setLocation(355,364);
        wallHeightSmall.setLocation(236,227);
        wallWidthMedium2.setLocation(345,182);
        wallWidthLong13.setLocation(508,489);
        wallWidthSmall.setLocation(525,6);
        wallWidthLong8.setLocation(355,10);
        wallHeightSmall.setLocation(246,201);
        wallWidthMedium2.setLocation(265,184);
        wallWidthLong13.setLocation(330,479);
        wallWidthLong7.setLocation(264,-3);
        wallWidthSmall10.setLocation(339,62);
        wallWidthLong10.setLocation(322,123);
        wallWidthLong3.setLocation(571,539);
        wallWidthLong2.setLocation(358,536);
        wallWidthLong5.setLocation(337,593);
        wallWidthSmall4.setLocation(375,363);
        removeObject(wallWidthSmall4);
        removeObject(wallWidthSmall9);
        removeObject(wallHeightSmall3);
        removeObject(wallHeightSmall4);
        wallWidthMedium4.setLocation(477,291);
        removeObject(wallWidthMedium4);
        removeObject(wallWidthSmall13);
        wallWidthLong7.setLocation(319,0);
        wallWidthLong5.setLocation(344,591);
        wallWidthLong2.setLocation(281,544);
        wallWidthLong13.setLocation(382,477);
        removeObject(wallWidthMedium6);
        wallWidthLong13.setLocation(522,475);
        wallWidthSmall3.setLocation(517,248);
        wallWidthLong11.setLocation(392,185);
        wallWidthLong10.setLocation(353,94);
        removeObject(wallWidthMedium);
        wallWidthMedium2.setLocation(273,178);
        wallWidthMedium2.setLocation(268,181);
        wallHeightSmall.setLocation(249,204);
        wallHeightMedium7.setLocation(170,177);
        removeObject(wallHeightSmall8);
        removeObject(wallHeightSmall21);
        wallHeightMedium12.setLocation(801,68);
        wallHeightMedium12.setLocation(802,97);
        wallHeightMedium12.setLocation(805,84);
        wallHeightMedium12.setLocation(798,119);
        wallHeightMedium13.setLocation(796,307);
        wallHeightSmall15.setLocation(400,55);
        wallWidthSmall12.setLocation(606,63);
        wallWidthLong8.setLocation(328,43);
        wallWidthLong8.setLocation(144,23);
        wallWidthMedium3.setLocation(333,416);
        removeObject(wallWidthMedium2);
        removeObject(wallWidthLong8);
        removeObject(wallWidthSmall10);
        removeObject(wallWidthLong3);
        wallWidthLong5.setLocation(448,599);
        wallWidthLong5.setLocation(450,597);
        wallWidthLong2.setLocation(314,537);
        wallWidthSmall2.setLocation(271,238);
        wallHeightSmall7.setLocation(332,261);
        wallWidthSmall2.setLocation(316,247);
        wallHeightSmall6.setLocation(330,343);
        wallWidthSmall3.setLocation(532,251);
        removeObject(wallWidthSmall3);
        addObject(wallWidthMedium2,500,241);
        wallWidthMedium2.setLocation(484,249);
        wallWidthSmall6.setLocation(680,121);
        wallHeightMedium13.setLocation(802,361);
        wallHeightMedium13.setLocation(796,417);
        wallWidthLong9.setLocation(76,15);
        removeObject(wallWidthSmall);
        removeObject(wallWidthLong7);
        Cheese cheese = new Cheese();
        addObject(cheese,754,555);
        Cheese cheese2 = new Cheese();
        addObject(cheese2,201,374);
        Cheese cheese3 = new Cheese();
        addObject(cheese3,40,281);
        Cheese cheese4 = new Cheese();
        addObject(cheese4,201,502);
        Cheese cheese5 = new Cheese();
        addObject(cheese5,594,139);
        wallWidthLong10.setLocation(301,92);
        wallWidthLong9.setLocation(140,3);
        wallWidthLong10.setLocation(320,5);
        wallWidthMedium5.setLocation(567,5);
        removeObject(wallWidthSmall7);
        WallWidthLong wallWidthLong14 = new WallWidthLong();
        addObject(wallWidthLong14,721,10);
        wallWidthLong14.setLocation(684,7);
        wallHeightSmall5.setLocation(458,385);
        wallHeightSmall6.setLocation(334,385);
        wallHeightSmall7.setLocation(357,216);
        wallWidthSmall2.setLocation(386,319);
        removeObject(wallWidthSmall2);
        wallHeightMedium10.setLocation(1,442);
        wallWidthSmall8.setLocation(133,84);
        wallHeightMedium8.setLocation(76,165);
        Cheese cheese6 = new Cheese();
        addObject(cheese6,203,38);
        cheese6.setLocation(203,32);
        wallWidthMedium2.setLocation(489,240);
        wallHeightSmall5.setLocation(450,375);
        wallWidthMedium3.setLocation(288,417);
        wallWidthLong13.setLocation(435,476);
        wallWidthLong5.setLocation(316,590);
        wallWidthLong10.setLocation(442,6);
        wallHeightSmall18.setLocation(240,82);
        wallHeightSmall18.setLocation(244,82);
        wallWidthSmall8.setLocation(142,80);
        wallHeightMedium8.setLocation(67,115);
        wallHeightMedium9.setLocation(72,282);
        wallHeightSmall9.setLocation(64,450);
        wallWidthSmall8.setLocation(107,73);
        wallHeightMedium7.setLocation(161,97);
        wallHeightSmall15.setLocation(400,46);
        wallHeightSmall18.setLocation(244,88);
        wallWidthMedium2.setLocation(447,239);
        wallHeightSmall5.setLocation(443,377);
        wallHeightSmall5.setLocation(452,382);
        wallHeightSmall5.setLocation(460,390);
        wallWidthMedium3.setLocation(305,433);
        removeObject(wallWidthMedium3);
        wallWidthLong12.setLocation(304,414);
        wallWidthLong12.setLocation(309,409);
        wallHeightSmall20.setLocation(681,199);
        wallHeightMedium3.setLocation(643,175);
        removeObject(wallHeightSmall20);
        cheese5.setLocation(597,117);
        cheese5.setLocation(600,94);
        Cheese cheese7 = new Cheese();
        addObject(cheese7,360,30);
        Cheese cheese8 = new Cheese();
        addObject(cheese8,422,384);
        Cheese cheese9 = new Cheese();
        addObject(cheese9,317,277);
        Cheese cheese10 = new Cheese();
        addObject(cheese10,44,566);
        addObject(wallHeightSmall20,22,570);
        wallHeightSmall20.setLocation(-6,570);
        wallHeightSmall20.setLocation(-2,574);
        wallHeightSmall10.setLocation(163,449);
        wallHeightSmall11.setLocation(226,456);
        wallHeightSmall12.setLocation(163,489);
        wallHeightSmall10.setLocation(170,462);
        wallWidthLong12.setLocation(171,417);
        removeObject(wallHeightSmall11);
        wallHeightMedium8.setLocation(38,244);
        removeObject(wallWidthSmall11);
        wallHeightMedium9.setLocation(60,350);
        wallHeightSmall9.setLocation(64,436);
        addObject(wallWidthSmall11,42,244);
        wallWidthSmall11.setLocation(21,247);
        wallHeightSmall10.setLocation(166,439);
        wallHeightSmall12.setLocation(124,449);
        removeObject(wallHeightSmall12);
        wallHeightMedium8.setLocation(61,228);
        wallHeightMedium9.setLocation(55,272);
        cheese3.setLocation(40,263);
        wallWidthLong12.setLocation(268,429);
        wallWidthLong5.setLocation(355,591);
        wallWidthLong2.setLocation(304,541);
        removeObject(wallWidthLong2);
        cheese4.setLocation(197,466);
        wallHeightSmall10.setLocation(177,468);
        cheese4.setLocation(194,463);
        wallHeightSmall10.setLocation(182,459);
        wallHeightSmall9.setLocation(68,465);
        removeObject(wallHeightSmall9);
        wallHeightMedium8.setLocation(67,180);
        removeObject(wallWidthSmall8);
        player.setLocation(24,209);
        wallHeightMedium8.setLocation(66,199);
        wallHeightMedium9.setLocation(68,265);
        wallWidthMedium2.setLocation(434,235);
        wallHeightMedium3.setLocation(642,259);
        wallWidthLong10.setLocation(322,5);
        Cheese cheese11 = new Cheese();
        addObject(cheese11,402,205);
        cheese11.setLocation(393,212);
        wallWidthMedium2.setLocation(388,255);
        wallWidthMedium2.setLocation(392,255);
        wallHeightSmall.setLocation(254,211);
        wallHeightMedium8.setLocation(92,185);
        wallHeightMedium9.setLocation(60,265);
        wallHeightMedium9.setLocation(72,259);
        wallHeightMedium8.setLocation(105,198);
        removeObject(wallHeightMedium8);
        addObject(wallHeightSmall9,107,176);
        wallHeightSmall9.setLocation(72,211);
        wallHeightSmall15.setLocation(402,47);
        wallHeightSmall5.setLocation(479,392);
        wallWidthLong12.setLocation(411,424);
        wallWidthLong12.setLocation(400,419);
        wallHeightSmall5.setLocation(457,388);
        cheese8.setLocation(435,394);
        cheese8.setLocation(432,395);
        cheese9.setLocation(281,224);
        cheese3.setLocation(38,275);
        wallHeightMedium9.setLocation(67,288);
        wallHeightMedium9.setLocation(67,270);
        wallHeightSmall9.setLocation(73,218);
        wallHeightMedium7.setLocation(152,117);
        wallHeightMedium3.setLocation(610,351);
        removeObject(wallHeightMedium3);
        wallWidthMedium2.setLocation(439,250);
        wallWidthLong12.setLocation(202,425);
        cheese4.setLocation(213,450);
        wallWidthLong5.setLocation(327,590);
        wallWidthLong13.setLocation(394,477);
        wallHeightSmall5.setLocation(466,387);
        wallHeightSmall16.setLocation(243,382);
        wallHeightSmall16.setLocation(243,366);
        wallHeightSmall9.setLocation(67,154);
        wallHeightMedium7.setLocation(153,38);
        wallHeightMedium7.setLocation(172,39);
        cheese6.setLocation(210,37);
        wallWidthLong10.setLocation(478,9);
        wallHeightMedium2.setLocation(720,285);
        wallHeightSmall15.setLocation(424,45);
        cheese7.setLocation(396,39);
        wallWidthLong5.setLocation(324,597);
        wallWidthLong12.setLocation(437,418);
        wallHeightSmall16.setLocation(240,395);
        removeObject(wallHeightSmall17);
        wallWidthLong13.setLocation(508,481);
        wallHeightSmall10.setLocation(175,444);
        wallWidthLong10.setLocation(347,-2);
        wallWidthLong10.setLocation(347,4);
        wallWidthMedium2.setLocation(370,250);;
        wallHeightSmall2.setLocation(553,241);
        removeObject(wallHeightSmall2);
        removeObject(wallWidthLong12);
        removeObject(wallWidthMedium2);
        removeObject(wallWidthLong5);
        removeObject(wallHeightSmall16);
        removeObject(wallHeightSmall6);
        removeObject(wallHeightSmall5);
        addObject(wallWidthLong5,351,445);
        wallWidthLong5.setLocation(321,481);
        wallHeightMedium6.setLocation(485,451);
        WallWidthSmall wallWidthSmall14 = new WallWidthSmall();
        addObject(wallWidthSmall14,323,415);
        wallWidthSmall14.setLocation(213,407);
        wallHeightSmall10.setLocation(170,434);
        wallHeightSmall10.setLocation(167,437);
        addObject(wallHeightSmall2,409,403);
        wallHeightSmall2.setLocation(414,448);
        cheese8.setLocation(451,445);
        addObject(wallWidthLong12,413,595);
        wallWidthLong12.setLocation(374,592);
        wallHeightSmall15.setLocation(427,47);
        removeObject(wallWidthLong5);
        wallHeightSmall10.setLocation(172,435);
        enemy2.setLocation(420,49);
        enemy2.setLocation(337,96);
        enemy3.setLocation(591,138);
        wallWidthLong13.setLocation(237,482);
        wallHeightSmall10.setLocation(195,464);
        wallWidthSmall14.setLocation(236,401);
        removeObject(wallWidthLong13);
        cheese4.setLocation(251,445);
        wallHeightSmall10.setLocation(204,412);
        wallWidthLong13.setLocation(323,468);
        cheese4.setLocation(246,431);
        wallWidthLong13.setLocation(230,463);
        wallWidthLong12.setLocation(398,593);
        wallHeightSmall15.setLocation(430,51);
        wallHeightSmall15.setLocation(429,44);
        wallHeightSmall10.setLocation(205,437);
        wallHeightSmall.setLocation(247,231);
        wallHeightSmall15.setLocation(431,53);
        wallHeightSmall15.setLocation(419,53);
        wallWidthLong12.setLocation(264,598);
        wallWidthLong12.setLocation(258,596);
    }
}
danpost danpost

2019/7/22

#
Remove the first word from line 263, "Player".
Scarley Scarley

2019/7/23

#
Thanks everything is fixed now,is there anyway to make the command tab bigger? or add a command log where i can set at least one example so the user can kind get an idea on what to do?
There are more replies on the next page.
1
2