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

2014/4/24

Help with moving a specific number of spaces

newprogramming newprogramming

2014/4/24

#
URGENT PLEASE HELP SOMEONE!!!!!!!!!- I count the amount of spaces i need it to move and then i have to go back and move with a mushroom in front is there a way I can get it to move with the mushroom the specific number of spaces needed I have attempted move(numberOfSpaces-1) but it moves without the mushroom. can someone please help me btw if u don't understand what i mean just comment what you dont understand and i'll explain better
danpost danpost

2014/4/24

#
You will have to show what code you currently are using. Also, a better (more detailed) explanation of how (and where) you move might be helpful (like do you go up and around the mushroom to get on the other side of it or what; are there obstacles to deal with; is your actor to move totally by AI or do you have any control on how it moves; things like that).
newprogramming newprogramming

2014/4/24

#
need it to move straight until the mushroom is on the leaf and there are no obstacles i just need to use the variable to get there so the lady bug will be behind the mushroom so it just needs to move the number of spaces needed minus 1 so i tried move(numberofspaces-1) but it just skips to the spot needed without moving the mushroom with it
danpost danpost

2014/4/24

#
newprogramming wrote...
need it to move straight until the mushroom is on the leaf and there are no obstacles i just need to use the variable to get there so the lady bug will be behind the mushroom so it just needs to move the number of spaces needed minus 1 so i tried move(numberofspaces-1) but it just skips to the spot needed without moving the mushroom with it
There are some implications in this as to what is going on. However, it is still not very clear and you still did not show any code.
newprogramming newprogramming

2014/4/24

#
this is what it looks like just need help with when it is in the first square and moving back to the leaf with the mushroom infront and i am completely lost on how to do that as i said i have tried move(numberofspaces-1) where number of spaces counts first square till leaf and i just need help figuring out how to return the ladybug back to the square in front with the mushroom in front and i would already have the mushroom in front just need to move it on top of the leaf
newprogramming newprogramming

2014/4/24

#
newprogramming newprogramming

2014/4/24

#
right click to view image
danpost danpost

2014/4/24

#
I could view the image (in a round about way); however, that does not help much without seeing any code. You should at least Post the classes for the ladybug and the mushroom.
newprogramming newprogramming

2014/4/24

#
actor classes
newprogramming newprogramming

2014/4/24

#
Mushrooms can be pushed by Clara if there is nothing behind them. The Mushrooms must be pushed onto a target (the Leafs). If a Mushroom is on target, a target image is shown. PERMITTED COMMANDS * Actions: move(), turnLeft(), turnRight(), putLeaf(), removeLeaf(), stop() * Sensors: onLeaf(), treeFront(), treeLeft(), treeRight(), mushroomFront() * JAVA: all java commands are permitted
newprogramming newprogramming

2014/4/24

#
permitted actions are for clara but i can create other methods
danpost danpost

2014/4/24

#
Again, cannot help without code to work with.
You need to login to post a reply.