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
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