i dont have a rotation code - as i dont know how it works using sin or cos...
but, i tried you examples, but it didnt work... well, at least the way i interpereted it and implemented it in a sample code! it just moves the X point down the screen? not rotating the triangle...
using YaBASIC:
open window 640,512
ex=500
ey=200
label loop
x=x+1
 setdrawbuf db
 db=1-db
 setdispbuf db
 clear window
angle=degrees*3.14159/180.0
triangle (ex+(x*sin(angle))),(ey+(x*cos(angle))) to ex,ey+20 to ex+5,ey+20
triangle (ex+(x*sin(angle))),(ey+(x*cos(angle))) to (ex+(x*sin(angle))+5),(ey+(x*cos(angle))) to ex+5,ey+20
goto loop
is that how you ment the code to be used? as you didn't define X, or change its value???
Thanx for you help!
ok.. i went through the old codes at Ezboard - memories... good ol' games!!! haha... and i have found a bit of code which rotates triangles through 2 points!!! OMG! i will try and put it onto my game... hopefully the collision detection will be fixed by my theroy!
i had to change some of it so that it rotated a triangle rather than the original circle.
with a bit of modification, i think that it will work!
heres the rotation code:
open window 640,512
label loop
setdrawbuf d
d=1-d
setdispbuf d
clear window
mm=mm+.025
x=100*sin(mm)+320
y=100*cos(mm)+256
x2=320
y2=256
setrgb 1,250,250,250
fill triangle x-5,y-10 to x2-5,y2+10 to x+5,y-10
fill triangle x+5,y-10 to x2-5,y2+10 to x2+5,y2+10
goto loop