Pages: 1
Topic closed
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
Offline
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
Offline
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
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
Offline
Topic closed
Pages: 1