Hey, so I've been working on a gun that shoots bullets. I have most things done, but now I need a way to make the bullet continue on forever. So far I have a script that shoots a bullet to the mouse using a glide block, but I need it to go until it reaches the border of the screen, even if the mouse isn't there. I hope that makes sense
Thanks in advance.
Offline
when i receiveshoot ▼point towardsmouse-pointer ▼repeat untiltouchingedge ▼?move5steps
Offline
DonutCannon wrote:
Hey, so I've been working on a gun that shoots bullets. I have most things done, but now I need a way to make the bullet continue on forever. So far I have a script that shoots a bullet to the mouse using a glide block, but I need it to go until it reaches the border of the screen, even if the mouse isn't there. I hope that makes sense
![]()
Thanks in advance.
Instead of using a glide block, use direction and move blocks...something like this should work:
EDIT: Wow, that's scary similar in timing and in script suggestionwhen I receiveshoot ▼This is how I would do it with a bullet, but maybe you did it differentlygo toplayer ▼point towardsmouse-pointer ▼showrepeat untiltouchingedge ▼?movenumberstepshide
Last edited by AtomicBawm3 (2012-07-10 12:42:23)
Offline
Ok, trying to make a form of accuracy.
Trying to use
[scratchblocks]
point towards [mouse-pointer]
point towards <<pick random (-20) to (20)> + <direction>
{scratchblocks]
Does not appear to work...
Offline
zammer990 wrote:
DonutCannon wrote:
Ok, trying to make a form of accuracy.
Trying to useDoes not appear to work...point towardsmouse-pointerpoint in directionpick random+-20to20directionfixedyourscripts ▼
Thanks. I saw the problem after writing, and I dunno how to edit my posts
Offline
DonutCannon wrote:
zammer990 wrote:
DonutCannon wrote:
Ok, trying to make a form of accuracy.
Trying to useDoes not appear to work...point towardsmouse-pointerpoint in directionpick random+-20to20directionfixedyourscripts ▼Thanks. I saw the problem after writing, and I dunno how to edit my posts
![]()
You can't until you're a scratcher, then there's just a box that says "edit" next to report
Offline
For a nice effect, try this:
go tocannon ▼point in directiondirection ▼ofcannon ▼setinaccuracy ▼topick random-0.10to0.10setspeedgain ▼topick random0.010to1.000setspeed ▼to1-speedgainifpick random=1to21setdir ▼to1elsesetdir ▼to2repeat untiltouchingedge ▼?movespeedstepschangespeed ▼byspeedgainifdir=1turn
inaccuracydegreeselseturn
inaccuracydegrees
Last edited by SciTecCf (2012-07-10 14:11:13)
Offline
SciTecCf wrote:
For a nice effect, try this:
go tocannon ▼point in directiondirection ▼ofcannon ▼setinaccuracy ▼topick random-0.10to0.10setspeedgain ▼topick random0.010to1.000setspeed ▼to1-speedgainrepeat untiltouchingedge ▼?movespeedstepschangespeed ▼byspeedgain
That would give the potential for an accelerating bullet, I guess it depends if you want realism or random
Offline
zammer990 wrote:
DonutCannon wrote:
Ok, trying to make a form of accuracy.
Trying to useDoes not appear to work...point towardsmouse-pointerpoint in directionpick random+-20to20directionfixedyourscripts ▼
K, got it to work. Thanks
Finished product here:
http://scratch.mit.edu/projects/DonutCannon/2666366
Of course, this isn't quite a game yet...
Offline