exam for the junior programmers . . .
There are 7 green images (food), and the "ant" should consist of a graphic object that can be moved using the arrowKeys
on the keyboard to "collect" the food (and as they are collected they should disappear), and this should be marked in
the "score" field at the top of the window.
This can be sorted out by script in the cardScript alone, using either if . . . then or switch statements.
This is the Kids' exam, summer 2017
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Kids' exam, summer 2017
Hi Richmond,
Thanks for summer work
I tried use
but it return true only when de ant body intersect img "maze.png" but not for one of ant's foot.
(LC indy 8.1.3)
Best regards
Jean-Marc
Thanks for summer work
I tried use
Code: Select all
intersect(img "maze.png",img gMyCurAnt,"opaque pixels")
(LC indy 8.1.3)
Best regards
Jean-Marc
https://alternatic.ch
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Kids' exam, summer 2017
Well, jmburnod, as the instructions clearly state that the "ant" should be a graphic object and NOT an image . . .
[ hint: set the backgroundPattern of grc "ant" to the img ID of image "A1.png" ]
[ hint: set the backgroundPattern of grc "ant" to the img ID of image "A1.png" ]
Re: Kids' exam, summer 2017
My take on it.
https://www.dropbox.com/s/c40jiwn36lroh ... ecode?dl=0
I too used an image object. oops.
https://www.dropbox.com/s/c40jiwn36lroh ... ecode?dl=0
I too used an image object. oops.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Kids' exam, summer 2017
Here's my NASTY solution (if the 'ant" hits the wall of the maze it goes all the way back
to the start and all its points are lost, and the food items are reset):
to the start and all its points are lost, and the food items are reset):