1. Make a countdown for every bounce off of the edge or another sprite, starting at 16?
2. Make something move 5 steps along only a single axis but be the same place as the mouse on that axis (or try).
Last edited by Firedrake969 (2012-07-21 13:45:40)
Offline
You could change a variable by 1 whenever it bounces, ad then the variable is 16 stop the script.
Offline
Wes64 wrote:
You could change a variable by 1 whenever it bounces, ad then the variable is 16 stop the script.
when gf clicked set [number v] to (16) if<<touching [edge v]>or<touching[sprite 1 v]>> change [number v] by (-1) endlike this?
Offline
Yes, but I have a more complicated script, so it might not fit in. Look at my game.
Offline
Anyone help me? This is an example of a block (or blocks) I need:
move (5) steps to (mouse x)
Last edited by Firedrake969 (2012-07-22 10:45:53)
Offline
Could you use something like this?:
forever if <(mouse x) < (x position)> point in direction (-90) else point in direction (90) end if <(abs ((mouse x) - (x position))) > (5)> move (5) steps end endsorry my scripts are a little messed up:L
Last edited by Prestige (2012-07-22 10:59:33)
Offline
Firedrake969 wrote:
1. Make a countdown for every bounce off of the edge or another sprite, starting at 16?
2. Make something move 5 steps along only a single axis but be the same place as the mouse on that axis (or try).
Offline
An example of what I need is
for (var1) changed by (-1) change (var2) by (-1)
Offline
You could change them at the same time...How do the variables relate to each other? Are they always equal? Always a certain amount apart?
Offline
Well, lets put it at this: If you buy an asset, you get it for a certain number of bounces. How do I make it count down until you have no bounces left, thus removing the asset?
Offline
An alternative for movement along a single axis (that I think is more simple):
when gf clicked forever if<([abs v] of ((mouse x)-(x position))) > [3]> if<(mouse x) > (x position)> change x by (5) else change x by (-5) endMaking it "greater than 3" instead of "greater than 5" is a slight improvement on the last script, and using the "change x" block more explicitly shows what you want (if someone wants to download and look/understand your script) as well as - arguably - more directly accomplishing it.
Last edited by MoreGamesNow (2012-07-24 15:40:43)
Offline
In your ball sprite, there is a script that looks like this:
if <touching [edge v]?> if <(gball) = [true]> point towards [Stick v] move (6) steps else point in direction ((180)-(direction)) move (6) steps turn cw (pick random (-40) to (40)) degrees end endAdd the "change [Bounces v] by (1)" block.
if <touching [edge v]?> change [Bounces v] by (1) if <(gball) = [true]> point towards [Stick v] move (6) steps else point in direction ((180)-(direction)) move (6) steps turn cw (pick random (-40) to (40)) degrees end end
Last edited by MoreGamesNow (2012-07-24 19:40:49)
Offline