SRL Archive - Help

Trigonometry help


wantonman

2012-06-28 03:37:34

Here is something that I would like to be re-written using Trig Functions so I can learn some Trig… This is for my studies



program cube;

var
x,y,a,b:Variant;
buffer1:integer;
buffer2:tcanvas;
bmp1:integer;
player:TMufasaBitmap;



begin

cleardebug;

bmp1:=BitmapfromString(10,10,'meJz7/38UEAsAuQ8q5A==');
DisplayDebugImgWindow(100,100);

a:=(1);
b:=(1);

x:=(0)
y:=(50)

repeat
begin
repeat

x:=x+a;
y:=y+b;

writeln(x);
writeln(y);

buffer1:=CreateBitmap(100,100);
FastDrawTransparent(x,y,bmp1,buffer1);
DrawBitmapDebugImg(buffer1);
FreeBitmap(buffer1);
wait(1);
until((x=100) or (y=99))
end;

begin
repeat
x:=x+a;
y:=y-b;

writeln(x);
writeln(y);

buffer1:=CreateBitmap(100,100);
FastDrawTransparent(x,y,bmp1,buffer1);
DrawBitmapDebugImg(buffer1);
FreeBitmap(buffer1);
wait(1);
until((x=99) or (y=50))
end;


begin
repeat

x:=x-a;
y:=y-b;

writeln(x);
writeln(y);

buffer1:=CreateBitmap(100,100);
FastDrawTransparent(x,y,bmp1,buffer1);
DrawBitmapDebugImg(buffer1);
FreeBitmap(buffer1);
wait(1);
until((x=50) or (y=0))
end;


begin
repeat

x:=x-a;
y:=y+b;

writeln(x);
writeln(y);

buffer1:=CreateBitmap(100,100);
FastDrawTransparent(x,y,bmp1,buffer1);
DrawBitmapDebugImg(buffer1);
FreeBitmap(buffer1);
wait(1);
until((x=0) or (y=50))
end;

until(false);

FreeBitmap(buffer1);
freebitmap(bmp1);
end.




Same concept but Re written using some Math because i really want to lean

Sir Ducksworthy

2012-06-28 08:51:21

Trigonometry 101 - Tutorial on Basic Trig Concepts to Help the Advanced Scripter
Have you had a good read of that yet?

wantonman

2012-06-28 14:41:00

i dont know i just want help… i read that and things would somebody be kind enugh to qive me examples that apply to my script

Abu

2012-06-28 14:42:31

what does the current script do? I just see lots of bitmaps…

wantonman

2012-06-28 15:19:14

its pong in a box, it has a cube and it bounces off the walls…