Discuss Scratch
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
we should add a way of making sprite groups (like creating a sprite folder/ group naming it and placing sprites inside) so a block like
imagine this script
but with sprite groups you could do this
another suggestion
point towards nearest sprite group[enemies v]this would help recreate games like sonic I don't think you can do scripting for homing attacks yet
imagine this script
when green flag clicked
forever
if <<<<<<<<<<touching [enemy v]?> or <touching [enemy2 v]?>> or <touching [enemy3 v]?>> or <touching [enemy4 v]?>> or <touching [enemy5 v]?>> or <touching [enemy6 v]?>> or <touching [enemy7 v]?>> or <touching [enemy8 v]?>> or <touching [enemy9 v]?>> or <touching [enemy10 v]?>> then
hide
broadcast [gameover v]
end
end
but with sprite groups you could do this
when green flag clickedthis would make things easier to organise sprites like if you had 50 sprites(it happens).
forever
if <touching sprite from sprite group [ enemies v]?::sensing> then
hide
broadcast [game over v]
end
end
another suggestion
point towards [nearest sprite v]
SUPPORTERS
ScratchJahd2011
Blaze349
Blaze349_test
scratch342
scratch342_test
year5l
Last edited by Blaze349 (Feb. 18, 2014 09:31:53)
- ProdigyZeta7
-
1000+ posts
SPRITE GROUPS!!!!!!!
This is far too specific to be used for a wide range of projects. And I'm sure there are workarounds. we should add a way of making sprite groups so a block likepoint towards [nearest sprite group"enemies" v]…
Last edited by ProdigyZeta7 (Feb. 21, 2014 23:03:25)
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
confused I still like the idea of grouping spritesI don't understand how this would work and I'm pretty sure there are workarounds. we should add a way of making sprite groups so a block likepoint towards [nearest sprite group"enemies" v]this would help recreate games like sonic I don't think you can do scripting for homing attacks yetalso there should be a way of when the ground starts to point downhill/uphill/anydirection sprite you're sprite will follow that direction not left right but up downOr how about:point in direction ([direction v] of [ground v])Then if you want it to move in the normal (perpendicular to the angle of the surface), turn it 90 degrees counterclockwise (if moving right) or clockwise (if moving left).
Last edited by Blaze349 (Jan. 12, 2014 23:23:05)
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
you would have to group the sprites yourself and the computer stores them or catagorizing the sprites into the groups if you are using themI don't understand how this would work and I'm pretty sure there are workarounds. we should add a way of making sprite groups so a block likepoint towards [nearest sprite group"enemies" v]this would help recreate games like sonic I don't think you can do scripting for homing attacks yet
- ScratchJahd2011
-
500+ posts
SPRITE GROUPS!!!!!!!
I'm not really sure, also homing (missiles?) is possible now, unless you mean enemy AI (which is also possible).
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
really how? I'm not really sure, also homing (missiles?) is possible now,).
Last edited by Blaze349 (Feb. 18, 2014 08:13:32)
- ScratchJahd2011
-
500+ posts
SPRITE GROUPS!!!!!!!
really how? I'm not really sure, also homing (missiles?) is possible now,).
This.
when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v])<(50)>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
but what if you want use multiple sprites not clones(badniks and the flying ones)really how? I'm not really sure, also homing (missiles?) is possible now,).
This.when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v])<(50)>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
how would that work as in to point to nearest
- ScratchJahd2011
-
500+ posts
SPRITE GROUPS!!!!!!!
but what if you want use multiple sprites not clones(badniks and the flying ones)really how? I'm not really sure, also homing (missiles?) is possible now,).
This.when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v])<(50)>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
how would that work as in to point to nearest
There, now you have a good point… (I don't know really…)
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
thats why we need sprite groupsbut what if you want use multiple sprites not clones(badniks and the flying ones)really how? I'm not really sure, also homing (missiles?) is possible now,).
This.when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v]) < [50]>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
how would that work as in to point to nearest
There, now you have a good point… (I don't know really…)
when i receive [fire missile v]
show
forever
if <(distance to nearest sprite of sprite group [ enemy v]::sensing) < [50]>
point towards nearest sprite of sprite group[enemy v]::motion
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
Last edited by Blaze349 (Feb. 18, 2014 09:12:48)
- ScratchJahd2011
-
500+ posts
SPRITE GROUPS!!!!!!!
thats why we need sprite groupsbut what if you want use multiple sprites not clones(badniks and the flying ones)really how? I'm not really sure, also homing (missiles?) is possible now,).
This.when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v]) < [50]>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
how would that work as in to point to nearest
There, now you have a good point… (I don't know really…)when i receive [fire missile v]
show
forever
if <(distance to nearest sprite of sprite group [ enemy v]::sensing) < [50]>
point towards nearest sprite of sprite group[enemy v]::motion
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
Okay, you have a point. 1+
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
yay 1 supportthats why we need sprite groupsbut what if you want use multiple sprites not clones(badniks and the flying ones)really how? I'm not really sure, also homing (missiles?) is possible now,).
This.when i receive [fire missile v]
show
forever
if <(distance to [player/enemy v]) < [50]>
point towards [player/enemy v]
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
how would that work as in to point to nearest
There, now you have a good point… (I don't know really…)when i receive [fire missile v]
show
forever
if <(distance to nearest sprite of sprite group [ enemy v]::sensing) < [50]>
point towards nearest sprite of sprite group[enemy v]::motion
move (10) steps
else
repeat (pick random (1) to (5))
move (5) steps
end
point in direction (pick random (-360) to (360)
end
end
Okay, you have a point. 1+
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
when green flag clicked
forever
change [support v] by (((999999999) * (999999999)))
end
- xlk
-
100+ posts
SPRITE GROUPS!!!!!!!
Groups would be awesome, for the “touching or or or or or…” but for pointing to closest of group… that can be worked around, and in my opinion is obsolete like the bounce on edge block.
- Blaze349
-
1000+ posts
SPRITE GROUPS!!!!!!!
what is the workaround Groups would be awesome, for the “touching or or or or or…” but for pointing to closest of group… that can be worked around, and in my opinion is obsolete like the bounce on edge block.