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

2012/6/25

Making actor score points/menu tourbleshooting.

1
2
3
4
ThinkingPainter ThinkingPainter

2012/6/25

#
I want my actor to score some points when he eats a ball, whats best way of achieveing this?// tried one of the menu demos Dan has and i cant get it to load with green foot. It launches it, but it doesnt launch the demo, but the game i'm currently working on.// Also wondering how to make my Goldenball actor that my Actor "Blip" eats, to appear at random times. Like Cherries do in Pac-Man games. Say the actor "Golden Ball" appears at random and doesn't disappear untill eaten by my main actor "Blip"... after eaten say he reappears 30sec-2min later. How would i achieve this code? Thanks.. for all the help guys. This is all new for me so i have alot of Questions!! :P
SPower SPower

2012/6/25

#
Take a look at this: http://www.greenfoot.org/doc/howto-1
ThinkingPainter ThinkingPainter

2012/6/25

#
how do i get the tutorial program to open with greenfoot? when i tried to load it on greenfoot it just goes to my current game im working on... not the tutorial with the rocket.
ThinkingPainter ThinkingPainter

2012/6/25

#
nvm about the last post i figured it out. and i took the shooting style from the tutorial you gave me. is there anyway to make it shoot the way you turn. So its not just shooting straight up?
SPower SPower

2012/6/26

#
When you create a 'bullet', set its rotation to your rotation, like this:
bullet.setRotation(getRotation());
ThinkingPainter ThinkingPainter

2012/6/26

#
i put it in: { Shot.setRotation(getRotation(5)); } getRotation() in greenfoot.actor cannot be applied to (int) what did i do wrong?
SPower SPower

2012/6/26

#
Remove the 5 from the (), it takes no parameters.
ThinkingPainter ThinkingPainter

2012/6/26

#
{ Shot.setRotation(getRotation()); } non-staticmethod setRoation(int) cannot be referenced from a static context i put the number in there to see if it would stop it. it did however i got that other error
SPower SPower

2012/6/26

#
why did you make a static method?
SPower SPower

2012/6/26

#
O, I'm sorry. You first need to create an object from the Shot class, like this:
Shot shot = new Shot();
// set the rotation
// add it to the world
And please, click on the code button beneath the text field, and indent your code right.
ThinkingPainter ThinkingPainter

2012/6/26

#
I dont know, i'm still in the process of learning how to work with programming so im a little dumb at times. :P
ThinkingPainter ThinkingPainter

2012/6/26

#
this new code news to go in with with my shot actor correct?
SPower SPower

2012/6/26

#
Yes
ThinkingPainter ThinkingPainter

2012/6/26

#
Shot shot = new shot(); // set the rotation // add it to the world { Shot.setRotation(getRotation()); } how do i fix: cannot find symbol - class Shot
SPower SPower

2012/6/26

#
I thought you had a class Shot, but you haven't :(!!!! Write that class, and then it should work if you remove these lines:
{
     Shot.setRotation(getRotation()); 
}
And please, click on the code button beneath the text field, and paste your code between the and the tags (without the spaces).
There are more replies on the next page.
1
2
3
4