3 ms·
I had to implement some unsatisfying hacks to make my Scratch shooter work as well! If I remember correctly I was manually duplicating the master projectile an
by dpritchett 13y ago
I had to implement some unsatisfying hacks to make my Scratch shooter work as well! If I remember correctly I was manually duplicating the master projectile and I had to register each projectile against each enemy.
- emehrkay 13y agoIm not sure if clone works as expected though. He has a laser beam and it listens for a 'shoot' broadcast. When it hears it, a clone of 'myself' is made, it is placed behind the ship, and a loop moves it to the left. However, if 'shoot' is broadcasted multiple times, new clones are not made and the same laser beam is placed behind the ship. Maybe we'll put the clone logic on the broadcast portion and not on the laser itself. Programming is fun, I can't wait to nudge him to try that approach
- TazeTSchnitzel 13y agoOne trick some people used was moving to several positions and "stamping".
- pflats 13y agoUsing 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.
- dpritchett 13y agoJust 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-8d0e5ed4d448/29f131d569ece22e606957b4f7c946ea https://www.evernote.com/shard/s4/sh/90b814fd-df52-4fcf-9127...