AST3_C/src/setlevel.c

37 lines
1.2 KiB
C

#include "setlevel.h"
#include <gint/std/string.h>
void set_level(int id_level, char level[], int *startx, int *starty)
{
switch(id_level)
{
case 1:
memcpy(level,"11111ddd111111111111001111000000000000000000000001000000000000001dddd100000000000000111110000000000010000000000001000000000021222000000000d000000000022000000000000d000000000012000000000000200000000001200000000000020000000000110001111000002000001122211000000101111100000100001100000010100020000010000110s00001000002000001000e111122111111dd111121100111",350);
break;
case 2:
memcpy(level,"1210011111111002110011122200000111ddd000111000000120000000000000011100000e1111111ddd111112211111121100000000000000000000d0000122111111dd111111200d000210002100000000011200d000200002100000000012100d000000000000000000011100d00001111dd11200000011100112222000011211ddd0021100111111000011111ddd00211001111110s0021111ddd0012100211111110021111111001110021111",350);
break;
}
unsigned int x = 0;
unsigned int y = 0;
unsigned int i = 0;
while (i!=strlen(level))
{
switch(level[i])
{
case 's':
*startx = x;
*starty = y;
break;
}
x+=16;
if(x==16*25)
{
x=0;
y+=16;
}
i++;
}
}