Fixed bug with multiple sprites in editor

This commit is contained in:
Rob Pearce 2008-09-27 11:35:24 +00:00
parent 90b6c34324
commit c3c3bf6579
2 changed files with 55 additions and 34 deletions

8
edit.c
View File

@ -208,7 +208,6 @@ int main (int argc, char **argv) {
y = (my / TILEH);
/* checks */
if (toggletimer == 0) {
// can only have one player start pos
if (selsprite == P_PLAYER) {
/* does a player start pos already exist? */
@ -235,21 +234,23 @@ int main (int argc, char **argv) {
}
}
}
}
if (!placed) {
if (toggletimer == 0) {
/* place selected sprite at mouse position
(locked to a til) */
(locked to a tile) */
if (selsprite == P_HELP) {
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"FILL ME IN", B_TRUE);
} else {
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"something", B_TRUE);
}
printf("added a sprite\n");
toggletimer = 30;
modified = B_TRUE;
drawsprites();
}
}
}
}
@ -307,6 +308,7 @@ int main (int argc, char **argv) {
drawtile(screen,x,y);
}
}
printf("cleared level\n");
}
}

View File

@ -9,10 +9,29 @@ monsters
C 33 7
C 11 13
r 13 5
r 19 21
r 7 17
S 28 24
s 23 1
@ 7 5
@ 25 9
P 25 5
P 7 9
Y 2 7
Y 1 7
Y 2 12
Y 1 12
Y 38 7
Y 30 7
Y 35 15
Y 38 15
Y 32 18
Y 9 21
Y 7 21
@ 18 17
@ 4 17
P 36 24
P 38 24
S 31 24
r 20 21
endmonsters
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,