alice-teacher Alice 3 Problems with vehicle and collisions

Don Slater don at alice.org
Thu Apr 30 16:21:33 EDT 2020


James,
I will be interested to see if the community has any better ideas than mine…

I created my own version before looking at your student solution, to think about how I would do this.

Instead of using the object mover method, I used keypress listeners to have my skunk jump forward or backward a certain amount with each press.

I did use the collision-start listener to set the vehicle of the skunk to the log, which worked generally well, but there was some weirdness, I suspect because I was using the irregularly shaped log models from the gallery. Your student may have better luck using the blocks he has created.

However, instead of using a collision-end event to reset the vehicle property of my skunk, I reset that property whenever there was a keypress event, (forwards or backwards).

You may also want to play with the event optional variable “multiple event policy” (see the attached screen shot, and set it to Ignore. I had my best success with that. I have also attached “skunker.a3p” for you to examine.

I also looked back through my archives to see if I had wrestled with this before. It turns out I did, but I begged the whole question by having my critter jumping across a road dodging vehicles that were moving back and forth. Those collisions were easier to manage ;-)

Let me know how it goes…

Don Slater

Alice Project



> On Apr 30, 2020, at 2:51 PM, Vanderhyde, James <vanderhyde at sxu.edu> wrote:
> 
> I have a student who is trying to make a Frogger-style game in Alice 3. The player needs to be able to ride logs across a river. He came up with an approach to set the vehicle of the player character to a log, when a collision event occurs. Then when the collision ends, set the vehicle back to the scene. The approach seemed sound, so I tried it in a simplified program (attached). There seems to be problems both with collision end events and with setting the vehicle. Maybe because the player character is moving?
> 
> I came up with a partial fix that is still unstable but works more reliably (attached). It uses a 0-length timer to check for collisions every frame, instead of using the collision event.
> 
> Any other suggestions? Or anywhere I should file an Alice 3 bug report?
> 
> James
>> James Vanderhyde
> Associate Professor and Department Chair
> Computer Science
> Saint Xavier University
> 3700 W. 103rd St.
> Chicago, IL 60655
> 773-298-3454
> <collision and vehicle demo.a3p><vehicle fix.a3p>_______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> 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/20200430/75c5c14a/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skunker.a3p
Type: application/octet-stream
Size: 315596 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200430/75c5c14a/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200430/75c5c14a/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1.jpg
Type: image/jpeg
Size: 41890 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200430/75c5c14a/attachment-0001.jpg>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200430/75c5c14a/attachment-0005.html>


More information about the alice-teachers mailing list