sto cercando di fare un mirino, in modo che quando si sposta il cursore si vede il mirino..
questo è l'esempio preso dal wiki di bennu
Code: Select all
import "mod_map"
import "mod_mouse"
import "mod_wm"
Process Main()
Private
int dmap;
int rmap;
int gmap;
int bmap;
int ymap;
int cmap;
int mmap;
int wmap;
Begin
// Create a dark graph
dmap = new_map(100,100,8);
map_clear(0,dmap,rgb(50,50,50));
// Create a red graph
rmap = new_map(100,100,8);
map_clear(0,rmap,rgb(255,0,0));
// Create a green graph
gmap = new_map(100,100,8);
map_clear(0,gmap,rgb(0,255,0));
// Create a blue graph
bmap = new_map(100,100,8);
map_clear(0,bmap,rgb(0,0,255));
// Create a yellow graph
ymap = new_map(100,100,8);
map_clear(0,ymap,rgb(255,255,0));
// Create a cyan graph
cmap = new_map(100,100,8);
map_clear(0,cmap,rgb(0,255,255));
// Create a magenta graph
mmap = new_map(100,100,8);
map_clear(0,mmap,rgb(255,0,255));
// Create a white graph
wmap = new_map(100,100,8);
map_clear(0,wmap,rgb(255,255,255));
Repeat
if(mouse.left) // +Red
if(mouse.right) // +Green
if(mouse.middle) // +Blue
mouse.graph = wmap;
else
mouse.graph = ymap;
end
else
if(mouse.middle) // +Blue
mouse.graph = mmap;
else
mouse.graph = rmap;
end
end
elseif(mouse.right) // +Green
if(mouse.middle) // +Blue
mouse.graph = cmap;
else
mouse.graph = gmap;
end
elseif(mouse.middle) // +Blue
mouse.graph = bmap;
else // Dark
mouse.graph = dmap;
end
frame;
Until(exit_status)
End
e questo è quello che ho provato a fare:
Code: Select all
//========================== PuntoNetto ================//
//========================== CODE:}Zip{ =================//
//=========================== GFX:}Zip{ =================//
//=========================== v.0.0.0.2 =================//
global
int gfx;
int mirino;
begin
set_mode(320,240,16);
gfx=load_fpg("gfx.fpg");
put_screen(gfx,1);
write(0,0,10,0,"press s");
menu();
loop
if(key(_ESC))
break;
end
frame;
end
let_me_alone();
end
///____________________________Menu
process menu()
begin
loop
if(key(_S))
livello1();
end
frame;
end
end
///____________________________Livello1
process livello1()
begin
mirino=gfx;
mirino=3;
nemico0(80,130);
repeat
mouse.graph=mirino;
frame;
until(exit_status)
loop
frame;
end
end
///___________________nemico0
process nemico0(x,y)
private
int i;
int xini;
begin
let_me_alone();
graph=gfx;
graph=2;
xini=x;
loop
if(flags==0)
if(x <= xini+50)
x=x+2;
else
flags=1;
end
else
if(x >= xini-50)
x=x-2;
else
flags=0;
end
end
i=i+1;
frame;
end
end
bene
il mirino non lo vedo T_T