Fixed bug with multiple sprites in editor
This commit is contained in:
parent
90b6c34324
commit
c3c3bf6579
8
edit.c
8
edit.c
|
@ -208,7 +208,6 @@ int main (int argc, char **argv) {
|
||||||
y = (my / TILEH);
|
y = (my / TILEH);
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
if (toggletimer == 0) {
|
|
||||||
// can only have one player start pos
|
// can only have one player start pos
|
||||||
if (selsprite == P_PLAYER) {
|
if (selsprite == P_PLAYER) {
|
||||||
/* does a player start pos already exist? */
|
/* does a player start pos already exist? */
|
||||||
|
@ -235,21 +234,23 @@ int main (int argc, char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!placed) {
|
if (!placed) {
|
||||||
|
if (toggletimer == 0) {
|
||||||
/* place selected sprite at mouse position
|
/* place selected sprite at mouse position
|
||||||
(locked to a til) */
|
(locked to a tile) */
|
||||||
if (selsprite == P_HELP) {
|
if (selsprite == P_HELP) {
|
||||||
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"FILL ME IN", B_TRUE);
|
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"FILL ME IN", B_TRUE);
|
||||||
} else {
|
} else {
|
||||||
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"something", B_TRUE);
|
addsprite(selsprite, x*TILEW+(TILEW/2),y*TILEH+TILEH,"something", B_TRUE);
|
||||||
}
|
}
|
||||||
|
printf("added a sprite\n");
|
||||||
toggletimer = 30;
|
toggletimer = 30;
|
||||||
modified = B_TRUE;
|
modified = B_TRUE;
|
||||||
drawsprites();
|
drawsprites();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,6 +308,7 @@ int main (int argc, char **argv) {
|
||||||
drawtile(screen,x,y);
|
drawtile(screen,x,y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("cleared level\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,29 @@ monsters
|
||||||
C 33 7
|
C 33 7
|
||||||
C 11 13
|
C 11 13
|
||||||
r 13 5
|
r 13 5
|
||||||
r 19 21
|
|
||||||
r 7 17
|
r 7 17
|
||||||
S 28 24
|
|
||||||
s 23 1
|
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
|
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,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,
|
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,
|
||||||
|
|
Loading…
Reference in New Issue