Hacker News new | ask | show | jobs
by pflats 4795 days ago
Using Alice 2.2 (which also doesn't allow cloning/instantiation) my students had a similar issue, and solved it by using what they called "Megaman logic".

Megaman could apparently only shoot N bullets at once (3 or 5, I forget). Thus, they only ever had 5 bullet objects, iterated through a list to see if the bullet was shot or not, and only let you fire if there was a spare bullet.

I thought it was very clever. Sounds like you did much of the same thing.

1 comments

Just so! I had three projectiles (rock1, rock2, rock3) and they shared a global "fire selector" that operated as a sort of mutex.

https://www.evernote.com/shard/s4/sh/90b814fd-df52-4fcf-9127...