boubou
28/07/2004, 12:58
hola, tengo un problema con los tiles, es el siguiente:
Cuano el prota se acerca a uno de los tiles, el tile se dibuja encima del prota, por que pasa esto? en el fxi de windows funciona bien...
este es el codigo:
//-----------------------------------------------
//Program:
//Author:
//Team:
//-----------------------------------------------
Program mijuego;
Global
i=0;
i2=0;
ntile=40;
tile=0;
tiles[]=1,1,2,1,2,1,2,1,2,2,
2,2,1,2,1,2,2,1,2,1,
2,2,1,2,2,1,2,1,2,2,
1,2,1,1,1,2,1,2,1,2,
1,2,1,2,1,1,2,1,2,2,
1,2,2,1,2,1,1,2,1,1,
2,2,2,1,1,2,1,2,1,2,
2,2,1,1,2,1,2,2,1,2;
Begin
set_title("");
Graph_mode = mode_16bits;
set_mode (m320x240);
load_fpg("pantalls/pantalls.fpg");
prota();
For(i=0;i<10;i++)
For(i2=0;i2<8;i2++)
tile++; If(tile==10)tile=0;End
dibujar_tile(i*32+16,i2*32+16);
End
End
End
Process dibujar_tile(x2,y2)
Begin
graph=tiles[tile];
Loop
x=x2;
y=y2;
Frame;
End
End
Process prota()
Begin
graph=3;
x=110;
y=120;
Loop
If(key(_up))y-=2;graph=6;Else
If(key(_down))y+=2;graph=3; Else
If(key(_left))x-=2;graph=5; Else
If(key(_right))x+=2;graph=4;
End
End
End
End
Frame;
End
End
Cuano el prota se acerca a uno de los tiles, el tile se dibuja encima del prota, por que pasa esto? en el fxi de windows funciona bien...
este es el codigo:
//-----------------------------------------------
//Program:
//Author:
//Team:
//-----------------------------------------------
Program mijuego;
Global
i=0;
i2=0;
ntile=40;
tile=0;
tiles[]=1,1,2,1,2,1,2,1,2,2,
2,2,1,2,1,2,2,1,2,1,
2,2,1,2,2,1,2,1,2,2,
1,2,1,1,1,2,1,2,1,2,
1,2,1,2,1,1,2,1,2,2,
1,2,2,1,2,1,1,2,1,1,
2,2,2,1,1,2,1,2,1,2,
2,2,1,1,2,1,2,2,1,2;
Begin
set_title("");
Graph_mode = mode_16bits;
set_mode (m320x240);
load_fpg("pantalls/pantalls.fpg");
prota();
For(i=0;i<10;i++)
For(i2=0;i2<8;i2++)
tile++; If(tile==10)tile=0;End
dibujar_tile(i*32+16,i2*32+16);
End
End
End
Process dibujar_tile(x2,y2)
Begin
graph=tiles[tile];
Loop
x=x2;
y=y2;
Frame;
End
End
Process prota()
Begin
graph=3;
x=110;
y=120;
Loop
If(key(_up))y-=2;graph=6;Else
If(key(_down))y+=2;graph=3; Else
If(key(_left))x-=2;graph=5; Else
If(key(_right))x+=2;graph=4;
End
End
End
End
Frame;
End
End