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

#1 2012-10-28 13:37:56

Sqervay
New Scratcher
Registered: 2012-10-28
Posts: 52

Need fast help for a game!

Hey guys,
i made a game where u have a cannon-platform, turning to the mouse-pointer.
Now i want to make that the bullets go in the direction the cannon is showing,
but i don't know how...
So, pls give me tips how to make this!
Sqervay
~sry, when my english is bad~

Offline

 

#2 2012-10-28 14:21:02

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: Need fast help for a game!

Well, for a cannonball sprite, you could have this script:

when gf clicked
forever
 hide
 wait until <mouse down?>
 go to [cannon v]
 show
 point in direction ([direction v] of [cannon v])
 set [vel v] to [0]
 repeat until <touching [edge v]?>
  move (2) steps //You can change this number.
  change y by (vel)
  change [vel v] by (-0.1) //You can change this number.
 end
 hide
 wait until <not <mouse down?>>
end
It's pretty basic, though. It'll need some tweaking.

Offline

 

#3 2012-10-28 15:47:53

Sqervay
New Scratcher
Registered: 2012-10-28
Posts: 52

Re: Need fast help for a game!

thx guy!

Offline

 

Board footer