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

2013/3/29

how do you create your own method like ascendHurdle in Greenfoot?

gquach gquach

2013/3/29

#
i wanted to create a method like jumpHurdle but it wasn't allowed and i had to declare it in Greenfoot using MyClara, what method do i have to use to create my own new method?
Gevater_Tod4711 Gevater_Tod4711

2013/3/29

#
The only thing you have to care for is that your syntax is correct and some other things you probably will never come across (e.g. you cant overwrite a final method). If you show us the code of your method we can help you to correct it.
danpost danpost

2013/3/29

#
Press Control-Shift-I for auto-layout (indents everything properly); then look to see if you have exactly one line with a close squiggly bracket as the first character at the end of the class code. If not, then you need to fix your bracketing. If problem still persists, then go through the code in the class and make sure each method starts at the first indent. I am presuming that you are getting a message that says something to the effect of 'class, type, or enum expected'.
You need to login to post a reply.