Kids' exam, summer 2017

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Kids' exam, summer 2017

Post by richmond62 » Fri Jul 14, 2017 9:43 am

antMaze.png
This is the 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.
Ant Maze.livecode.zip
This is the Template stack.
(14.67 KiB) Downloaded 455 times

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Kids' exam, summer 2017

Post by jmburnod » Fri Jul 14, 2017 1:39 pm

Hi Richmond,
Thanks for summer work
I tried use

Code: Select all

intersect(img "maze.png",img gMyCurAnt,"opaque pixels")
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
https://alternatic.ch

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Kids' exam, summer 2017

Post by richmond62 » Fri Jul 14, 2017 6:45 pm

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" ]

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Kids' exam, summer 2017

Post by sturgis » Fri Jul 14, 2017 6:51 pm

My take on it.

https://www.dropbox.com/s/c40jiwn36lroh ... ecode?dl=0

I too used an image object. oops.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Kids' exam, summer 2017

Post by richmond62 » Fri Jul 14, 2017 7:03 pm

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):
Ant Maze END.livecode.zip
(197.22 KiB) Downloaded 452 times

Post Reply

Return to “Games”