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

#1 2008-06-15 21:14:43

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

experimental scrolling shooting technique (really useful)

if you know scrolling pretty well you may have already thought of this, but this isn't to hard to make, this technique allows you to shoot a enemy that scrolls, but is beyond the boundaries of the screen,
EX and EY = are the scroll variables for the enemy
BX and BY = are the scroll variables for the bullet
time = is a variable for how many times the movement has been repeated
scrollX and scrollY are pretty basic

you should already know how to use scrolling bullets but here's the full technique

<set time to 0>
<repeat until: <<touching (enemy)> or <t<time = 15> or <<BX < EX + 2> and <BX > EX - 2> and <BY < EY + 2> and <BY > EY - 2>>>>>
change EX by ((sin of (direction) * 1) * (speed * -1))
change EY by ((cos of (direction) * 1) * (speed * -1))
go to (X (EX-scrollX)) (Y (EY-scrolY))
if <<<Y position < 180> and <Y position > -180>> and << X position < 240> and X position > -240>>>
show
else
hide
________ end of script
this is only the changed portions of the shooting script if you can't fix it up you shouldn't be using this


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#2 2008-06-15 21:15:46

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

oops looks like a few things showed up, oh well try to figure it out


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#3 2008-06-15 21:19:10

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

I'm going to test this right now, of course results from this are unlikely because this means you're shooting blindly


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#4 2008-06-15 21:49:18

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

Looks complicated... My dad explained trigginometry to me earlier on but I didn't fully understand it.

Offline

 

#5 2008-06-15 21:58:38

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

I understand how it works, it divides the hypotenuse, opposite, and adjacent sides of a triangle, I still don't understand how it affects one number, this technique I learned partially from archmage


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#6 2008-06-15 22:57:29

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

I made an easier technique that tells exactly where the bullet and enemie is, it was meant for 2 player, but it should work for bullet and enemie. Here it is http://scratch.mit.edu/projects/deatheater/178685

Offline

 

#7 2008-06-15 23:35:50

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

oh 2 player stuff, yeah, but that could be used in split screens with fake bullets


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#8 2008-06-16 01:29:20

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: experimental scrolling shooting technique (really useful)

dingdong wrote:

oh 2 player stuff, yeah, but that could be used in split screens with fake bullets

If you looked it uses a method that tells the exact position of p2, that could be used to tell the exact position of bullet and enemie  smile

Offline

 

Board footer