This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-16 19:02:51

moonstripe11
New Scratcher
Registered: 2012-07-16
Posts: 1

Questions regarding Shooters

I want to make a pistol, which shoots every time the player presses "space". I have it set to move 100 steps in a forever loop, so it gets stuck on the side of the screen, and I can't shoot anymore.

Offline

 

#2 2012-07-16 19:12:11

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Questions regarding Shooters

forever
if <key [space v] pressed?>//add this
go to x: ([x position v] of [pistol v]) y: ([y position v] of [pistol v])
else
move (100) steps


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#3 2012-07-16 19:16:27

DonutCannon
New Scratcher
Registered: 2012-07-02
Posts: 29

Re: Questions regarding Shooters

if <touching [edge]
goto x:[gun]  y:[gun]
Just replace x:gun and y:gun with the actual position of the gun.

Offline

 

#4 2012-07-16 19:18:30

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: Questions regarding Shooters

DonutCannon wrote:

if <touching [edge v]?>
go to x: [gun]  y: [gun]
Just replace x: gun and y: gun with the actual position of the gun.

Fixed.

Last edited by 360-International (2012-07-16 19:18:40)


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

Board footer