Тёмный

Greenfoot On-Screen Test Part 6 - Adding a Counter 

Allen Heard
Подписаться 427
Просмотров 15 тыс.
50% 1

Download the scenario used in these videos here - bit.ly/wjecicebreaker

Опубликовано:

 

3 мар 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@kanewilliams6764
@kanewilliams6764 7 лет назад
Exam is in a couple of hours. Only just discovered these videos now and are very good. Thanks!
@RahulKumar-qe5oq
@RahulKumar-qe5oq 5 лет назад
do u wanna meet up??
@edwardwilcock8145
@edwardwilcock8145 7 лет назад
I just got full marks on the greenfoot part of my exam because of your videos. Thank you so much.
@MrAHeard
@MrAHeard 7 лет назад
Arthur B that's great news, really pleased for you, well done!
@omarboudiab6493
@omarboudiab6493 6 лет назад
Thank you, you really saved my day :D Now I fixed my game which I'll have to return it tmrw. Thanks once Again :D
@pcsanch1023
@pcsanch1023 7 лет назад
This really helped me to actually understand the code and I'm sure will make unit 2 much easier, thanks a lot! :D
@geekoslicer
@geekoslicer 6 лет назад
every time my sharks eat the fish it opens up a new window of some greenfoot terminal thing, the last bit is not working
@TAIGZZZZ
@TAIGZZZZ 5 лет назад
I’ve done everything and I still get a non static method thecounter() cannot be referenced from a static context
@agnelabraham492
@agnelabraham492 7 лет назад
So HELPFUL Thx
@snowycr193
@snowycr193 4 года назад
so my game is collecting coins instead of breaking icebergs, but can someone tell me how to make an end screen after i collect all the coins?
@zuthandrapus799
@zuthandrapus799 5 лет назад
Watching this on a bench outside before the exam with 5 of us crowded around my phone, thanks I suppose
@dylantillman4895
@dylantillman4895 5 лет назад
good luck, this gunna be harder than the paper 1
@TwainP
@TwainP 5 лет назад
Can confirm, was on the bench earlier
@MrAHeard
@MrAHeard 5 лет назад
Zuthandrapus best of luck!
@zuthandrapus799
@zuthandrapus799 5 лет назад
Update on the exam, WJEC sent a message to the invigilator to tell us not to do question 9 at all - question 9 is the Greenfoot question. This because somebody messed up the code for the counter
@MrAHeard
@MrAHeard 5 лет назад
Zuthandrapus no they told centres to use the wrong version of Greenfoot
@ebonymadeley1077
@ebonymadeley1077 4 года назад
It isn't working for me The WHITE is unterlined red what should I do
@woozleproductions9760
@woozleproductions9760 5 лет назад
Help, I got everything to work but when the counter increases, it automatically decreases. My exams are in a few weeks and I'm hoping to get this to work because not even my teacher knows how to and I want to try and get full marks with Greenfoot. Please help.
@MrAHeard
@MrAHeard 5 лет назад
Woozle 03 Productions Check you haven’t got another piece of code decrementing the counter somewhere. Compare the code carefully. Also make sure you are not adding the counter every time something happens otherwise the default value of zero will be implemented.
@JadenHercules
@JadenHercules 6 лет назад
First half doesn't seem to work.
@MrAHeard
@MrAHeard 6 лет назад
Jaden Hercules You must have made an error because as you can see from the video it works.
@JadenHercules
@JadenHercules 6 лет назад
Yeah, what had happened was I didn't have an actor for my counter which was my mistake. Not sure if it's working now, but I'll let you know once I go to my class.
@MrAHeard
@MrAHeard 6 лет назад
Jaden Hercules Great, good luck!
@oisinoconnor2867
@oisinoconnor2867 6 лет назад
I have copied every single bit of your code and I keep getting "non-static method getCounter() cannot be reference from a static context".
@oisinoconnor2867
@oisinoconnor2867 6 лет назад
Nevermind I found the problem. My problem was that I used different code so as to remove the icebergs. Thanks for this.
@figfiger8287
@figfiger8287 4 года назад
Oisín O'Connor Same I’m so confused
@jasjotheer5985
@jasjotheer5985 3 года назад
I know it’s been 2 years but help me please
@cardaroy3556
@cardaroy3556 5 лет назад
Counter counter = ocean.getCounter(); comes up with "non-static method getCounter() cannot be referenced from a static context"
@MrAHeard
@MrAHeard 5 лет назад
cardaroy you need to create the getCounter method in the world class
@Mia-iw6kc
@Mia-iw6kc 5 лет назад
Vladiboy I’ve got the same problem, and I’ve created the method In world
@TAIGZZZZ
@TAIGZZZZ 5 лет назад
Same
@gmgarcia11
@gmgarcia11 5 лет назад
@@Vladiboy This worked for me. Thank you.
@jasjotheer5985
@jasjotheer5985 3 года назад
@@Vladiboy where do I add this code in my world or the ship please help I have the same problem
@Killa250
@Killa250 7 лет назад
this can be done in 2 lines of code :)
@MrAHeard
@MrAHeard 7 лет назад
feel free to add your response as a helpful point
@Killa250
@Killa250 7 лет назад
declare 'score' in the counter class (before any method) public int score = 0; then just add these lines to the main actor's class (at the bottom of the act method) Counter counter = (Counter) getWorld().getObjects(Counter.class).get(0); counter.score = counter.score + 1 if you need to take away score (e.g a secondary actor taking away score if it collides with the main actor) then simply put those lines into the secondary actor's class and change the + 1 to - 1
@brownbagel.
@brownbagel. 7 лет назад
KillaElectriix- im getting a nullPointerException error, should I be putting 'new' anywhere?
@MrAHeard
@MrAHeard 7 лет назад
GEITH ABDUL MAJID use the method in this video, works just fine.
@brownbagel.
@brownbagel. 7 лет назад
Mr A Heard -I tried the method in the video but there is one problem: in my main actor where I typed "Counter counter = Ocean.getCounter ();" there is an error on "getCounter" that says non static method getCounter() cannot be referenced from a static context.