alice-teacher array collision Alice3

Leonel Morales litomd at gmail.com
Thu Jun 11 08:04:03 EDT 2015


Hi Julie,

I guess you are using Alice 3.2.5. I made a simple game in Alice 3.2.5 that
does something similar. When ammo hits a target both disappear. In the
collision started event listener the code checks if the ammo is visible and
if it is a procedure is called:

[image: Imágenes integradas 1]

When the DestroyAlien procedure gets called it compares the received SThing
parameter with each one of the members of an array that contains all the
destroyable objects (the aliens). The comparison is made using the toString
function:

[image: Imágenes integradas 2]

When the hit alien is found the ammo and the alien grow and shrink back
very fast and then both disappear.

This video shows it running: https://www.youtube.com/watch?v=kROiAz7xeL0

The project is attached.

Leonel


2015-06-10 7:43 GMT-06:00 JOHNSON JULIE M. <JJOHNSON at williamsvillek12.org>:

>  How do you take an object and when it collides with one of the objects
> from the array have the object hit’s opacity turn to 0?  I can do collision
> and have the hitting object disappear or turn or move but do not know how
> to make the object hit disappear.  I assumed you would do this in the
> collision starter also but could be wrong.
>
> Thanks.  Julie Johnson
>
>
>
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150611/82909d4a/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 337771 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150611/82909d4a/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 346755 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150611/82909d4a/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SpaceInvaders.a3p
Type: application/octet-stream
Size: 121024 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150611/82909d4a/attachment-0001.obj 


More information about the alice-teachers mailing list