So I'm trying to make a game that involves using a lot of the same things over and over on one screen. I was thinking I could use stamping but I'm having trouble... can I still do this with stamping, or should I do something else? Here's what I'm trying to do:
Ok so I have pies and bombs on the screen, they appear randomly. When my sprite touches any pie the pie should disappear, when my sprite touches any bomb it should blow up and the game should be over. I don't think I can do this with stamping, so what should I do instead? I need some ideas
Thanx 4 the help I've gotten already! looks like I won't use stamping, is there any other way though besides making a million pies and bombs (I can do that it's just I'd rather not)?
Last edited by tree-hugger (2012-08-27 20:18:37)

...ya, I'm weird... REAL weird...Offline
Do not use stamping because you will need each of the bombs to have their own script. Stamping will be deperately hard to work with. Heres some suggestions: make how many bombs or pies you want that would show up on the screen at the same time, use hide and show for disappearing and reappearing.
idk if this would help but good luck
Offline
I would think the easiest solution to this kind of problem would be to make the objects of which you have a lot do the sensing, instead of your player sprite.
Try scripting one pie/bomb so it behaves the way you want it to, without scripting stuff specifically for this pie/bomb in the player sprite. You can then duplicate this sprite as much as you like.
For example:
when I receive [start level v] //add this to your bomb sprite(s) go to x: (pick random (-200) to (200)) y: (pick random (-150) to (150)) show //look like a bomb :) set size to (100)% switch to costume [bomb v] wait until <touching [player v]?> switch to costume [explode v] //explosion animation repeat (10) change size by (20) change [ghost v] effect by (10) end broadcast [game over! v]Your player can then receive the "game over!" broadcast.
set [bombs shown v] to (0) //on stage/player set [total bombs v] to (5) broadcast [start level v]And then, on every bomb/pie...
when I receive [start level v] if <not <(bombs shown) < (total bombs)>> hide stop script end change [bombs shown v] by (1) show // add the rest of the script from above here
Last edited by JSO (2012-08-28 05:37:10)
Offline
Actually, stamping is perfect for this! All you need is a simple little script and 3 lists.
First, you'll need 2 costumes in a sprite: Bomb and Pie, in that order.
Now, make 3 lists: Type, X, and Y.
Next, a variable: counter.
Let's start off our script. We'll do this:
when gf clicked delete (all v) of [Type v] delete (all v) of [X v] delete (all v) of [Y v] forever clear hide set [counter v] to [1] endLet's start with the stamping script. We'll need to add this to the bottom of the loop:
if <not <(counter) > (length of [Type v])>> show switch to costume (item (counter) of [Type v]) go to x: (item (counter) of [X v]) y: (item (counter) of [Y v]) stamp if <touching [player v]?> if <(item (counter) of [Type v]) = [1]> delete (all v) of [Type v] delete (all v) of [X v] delete (all v) of [Y v] broadcast [game-over v] else delete (counter) of [Type v] delete (counter) of [X v] delete (counter) of [Y v] broadcast [pie-collected v] end end hide change [counter v] by (1) endSo, our script now looks like this:
when gf clicked
delete (all v) of [Type v]
delete (all v) of [X v]
delete (all v) of [Y v]
forever
clear
hide
set [counter v] to [1]
if <not <(counter) > (length of [Type v])>>
show
switch to costume (item (counter) of [Type v])
go to x: (item (counter) of [X v]) y: (item (counter) of [Y v])
stamp
if <touching [player v]?>
if <(item (counter) of [Type v]) = [1]>
delete (all v) of [Type v]
delete (all v) of [X v]
delete (all v) of [Y v]
broadcast [game-over v]
else
delete (counter) of [Type v]
delete (counter) of [X v]
delete (counter) of [Y v]
broadcast [pie-collected v]
end
end
hide
change [counter v] by (1)
end
end
Now, we right click on the if just below the set counter block and select duplicate. Put it just above the if that you right clicked on. Repeat this process 6 times.add [1] to [Type v] //1 is bomb, 2 is pie. You can use a pick random block here. add [0] to [X v] //X position of new object. Use pick random block. add [0] to [Y v] //Y position of new object. Use pick random block.
Offline
You store the locations of the stamps in variables, so the screen can be redrawn at any time. That's basically how a 1s1s project works: in the "draw" section of the script, the single sprite goes to all the locations in the screen that it needs to and either stamps itself (after switching to the right costume) or uses the pen to draw lines, etc.
Offline
amcerbu wrote:
You store the locations of the stamps in variables, so the screen can be redrawn at any time. That's basically how a 1s1s project works: in the "draw" section of the script, the single sprite goes to all the locations in the screen that it needs to and either stamps itself (after switching to the right costume) or uses the pen to draw lines, etc.
OHHHHH... ok my life is making a lot more sense!
That's how 1s1s works! Ok well, I'll do that hope I can make the scripts work! Thanx a lot

...ya, I'm weird... REAL weird...Offline
Hi tree hugger!!!
Offline
@tree-hugger - Yeah. You can break up a 1s1s project into a bunch of "broadcast and wait" blocks and "when I receive" hats for ease of readability, or if the 1s1s is lagging too much. It also helps organize your code.
If you're using a bunch of bombs, you can have a single "bombs" sprite that holds a list of x positions and a list of y positions. At any point, it can go to (item 1 of x, item 1 of y) and stamp to draw a bomb, or any item number, for that matter. When you have to draw the screen, you use a loop to go through all the items in x and y lists and stamp. This usually requires the project to run in turbo mode.
Last edited by amcerbu (2012-08-29 01:15:58)
Offline
amcerbu wrote:
@tree-hugger - Yeah. You can break up a 1s1s project into a bunch of "broadcast and wait" blocks and "when I receive" hats for ease of readability, or if the 1s1s is lagging too much. It also helps organize your code.
If you're using a bunch of bombs, you can have a single "bombs" sprite that holds a list of x positions and a list of y positions. At any point, it can go to (item 1 of x, item 1 of y) and stamp to draw a bomb, or any item number, for that matter. When you have to draw the screen, you use a loop to go through all the items in x and y lists and stamp. This usually requires the project to run in turbo mode.
Ya... I was trying to do something like that
just needed an idea of how too thanx!

...ya, I'm weird... REAL weird...Offline