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

2015/10/21

How can I make pressing a key create an actor?

Zinkley Zinkley

2015/10/21

#
I have this game and i want it so that when you press spacebar it will place an actor right behind another actor. So there is a crab and when spacebar is pressed i want a poop pile(it slows down the enemies) to appear behind the crab but i've run into many problems. First: I want there to be a limited number of times this can be done maybe 3 Second: When i write the code in the crab actor it is unable to place a new actor; it brings up an error message. Third: I don't know how to get the new actor to appear directly behind the crab. Thank you so much :)
davmac davmac

2015/10/21

#
You've got three problems here - try to ask one thing at a time. It's easier to help you then. I'd start with this:
Second: When i write the code in the crab actor it is unable to place a new actor; it brings up an error message.
You have an error message, so you need to post it. You have code, so you need to post that too. And as a general hint: the time I've taken to write this means I've got less time to help you (and others) actually solve the problem(s). Try to be more specific and give more information. Always post your code; always post the exact text of any error message (and point out which line in the code the error occurs on).
You need to login to post a reply.