Log in

View Full Version : Trigonometry help



wantonman
06-28-2012, 07:37 AM
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
06-28-2012, 12:51 PM
Trigonometry 101 - Tutorial on Basic Trig Concepts to Help the Advanced Scripter (http://villavu.com/forum/showthread.php?t=22334)
Have you had a good read of that yet?

wantonman
06-28-2012, 06:41 PM
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
06-28-2012, 06:42 PM
what does the current script do? I just see lots of bitmaps...

wantonman
06-28-2012, 07:19 PM
its pong in a box, it has a cube and it bounces off the walls...