Code: Select all
;
targetx = 24 ; end location
targety = 14
shootx = 157 ; start location
shooty = 104
; this works great with the following values:
;targetx = 24 ; end location
;targety = 14
;shootx = 157 ; start location
;shooty = 104
; or any values where the target is smaller than the shooter
; but not the other way around...
;what If the values were reversed... I cannot figure out
;how To create an even path no matter what the values are
Steps = 20 ; number of steps required to go from shoot to target
Dim spotx(21) ; array to hold x position
Dim spoty(21) ; array to hold y position
xx = shootx / Steps
yy = shooty / Steps
Debug "Starting"
For number = 0 To Steps ; stepladder was set to 10 initially... I wanted to be able to change this value later
hopx = number * xx ; variable to subtract from shooter
hopy = number * yy
placex = shootx - hopx
placey = shooty - hopy
spotx(number) = placex
spoty(number) = placey
Debug placex
Debug placey
Next
End
;


