Trig
Author |
Message |
upthescale
|
Posted: Thu Jun 08, 2006 9:58 pm Post subject: Trig |
|
|
code: |
setscreen ("offscreenonly;graphics:400;340;position:100;100;nobuttonbar")
var Move : array char of boolean
var Radius := 8
var Aimerx := 50
var Aimery := 50
var Fire := 1
var Theta : int := 1
var Ballx, Bally : int := 200
procedure GuyAndMovement
Mouse.Where (Aimerx, Aimery, Fire)
Mouse.Where (Aimerx, Aimery, Fire)
Draw.FillOval (Ballx, Bally, Radius, Radius, red)
Draw.ThickLine (round (cosd (Theta) * Radius + Ballx - 8), round (tan (Theta) * Radius + Bally - 12),
round (tan (Theta) * Aimerx), round (tan (Theta) * Aimery), 2, red)
end GuyAndMovement
loop
colorback (7)
cls
GuyAndMovement
delay (15)
View.Update
end loop
|
my problem is that it can exten, i want the line to be about 2 inches long, but notice when u move ur mouse it will extend, how cnai prevent this? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Clayton
|
Posted: Thu Jun 08, 2006 10:14 pm Post subject: (No subject) |
|
|
it is extending because you have your mouse variables in there, which can change to a larger amount than you want, to fix this have an if statement to check if the line is longer than the desired amount, if it is set the variables controlling x and y to a certain amount, also why do you have two Mouse.Where with the exact same parameters? the second one is achieving nothing at all |
|
|
|
|
|
upthescale
|
Posted: Fri Jun 09, 2006 10:29 am Post subject: (No subject) |
|
|
ops i didnt meen to d that lol thx |
|
|
|
|
|
|
|