Basically, they use variables instead of broadcasts and multiple scripts. So something like this:
when gf clicked set [score v] to (0) set [lives v] to (3) set [x1 v] to <pick random (-200) to (200)> set [y1 v] to <pick random (-200) to (200)> set [x2 v] to <pick random (-200) to (200)> set [y2 v] to <pick random (-200) to (200)> reset timer forever go to x:(x1) y:(y1) point towards [mouse-pointer v] move <(timer) / (3)> steps set [x1 v] to (x position) set [y1 v] to (y position) if <touching [mouse-pointer v]?> change [score v] by (timer) change [lives v] by (-1) reset timer if <(lives) < (1)> stop script end set [x1 v] to <pick random (-200) to (200)> set [y1 v] to <pick random (-200) to (200)> end go to x:(x2) y:(y2) point towards [mouse-pointer v] move <(timer) / (3)> steps set [x2 v] to (x position) set [y2 v] to (y position) if <touching [mouse-pointer v]?> change [score v] by (timer) change [lives v] by (-1) reset timer if <(lives) < (1)> stop script end set [x2 v] to <pick random (-200) to (200)> set [y2 v] to <pick random (-200) to (200)> endTwo "enemies" or Scratch Cats spawn and chase the mouse-pointer. The goal is to wave the mouse-pointer around and "survive" until you loose all your lives.
Last edited by Magnie (2012-02-18 22:31:53)
Offline
Thanks for your feedback, but I'm talking about a project like this:
World Jump
Offline
pi3 wrote:
Thanks for your feedback, but I'm talking about a project like this:
World Jump
That game was made by stamping (I think) the floor/world/monsters/items/etc then stamping the character. Then they check for user-input, act accordingly. Then they check for collisions, act accordingly. Then check for anything else (for the end of the level, a coin, etc), and once again, act accordingly.
The script I made can probably be done in simpler terms with lists. But for the sake of clearly showing what's happening, it's been made like that.
Edit:
pi3 wrote:
Okay, so basically, there is one sprite that goes back and forth between two locations, but it switches back and forth so fast that it looks like there are two sprites?
Yes, exactly.
Last edited by Magnie (2012-02-18 22:42:31)
Offline
pi3 wrote:
Thanks so much! You've been a big help!
Anytime. Did you try it? I need to make sure the script works, since I never tested it in Scratch.
Offline
@pi3: You're right that it switches back and forth, but it often stamps its costume in multiple places. There is a slight delay in Scratch's "repeat" and "forever" blocks (between each execution of the script inside the loop), so the stamped images remain on the screen for a fraction of a second before the stage is cleared and the sprites stamp themselves in new locations. One of my projects is 1s1s, but uses the pen instead of stamping.
Offline
1s1s are really fun, but complex 1s1s games are really hard.
Offline
Don't forget to stamp!
Offline
1s1s games are a type of game usually created as a challenge to the creator. Some are really simple, while others are extremely complicated (I think I've seen one that ran out of space in the programming area). 1s1s games use stamping to give the illusion of other sprites. Another form, 1s1s1c, only has one costume, so stamping other "sprites" is out of the question. In this case, most 1s1s1c games are single-level, interacting with the colors of the backround. The multi-level 1s1s1c games cannot have changing backrounds, or it would by a 1s2s1c game. Instead, the creator would use pen to create levels, which creates extremely long scripts.
Offline
Hmm...
Offline