]> 4ch.mooo.com Git - 16.git/commitdiff
wwww init player www
authorsparky4 <sparky4@cock.li>
Sun, 17 Apr 2016 21:15:32 +0000 (16:15 -0500)
committersparky4 <sparky4@cock.li>
Sun, 17 Apr 2016 21:15:32 +0000 (16:15 -0500)
src/lib/16_head.h
src/lib/16_in.c
src/lib/16_in.h
src/scroll.c

index 3217ea2ed760a07cde59f424e31c3134415776d6..4b9972f1e3bdc3d0020738a6248002906e7a2efd 100755 (executable)
@@ -50,6 +50,7 @@
 #include "src/lib/nyan/kitten.h"\r
 #include "src/lib/types.h"\r
 #include "src/lib/typdefst.h"\r
+#include "src/lib/16_in.h"\r
 \r
 #define VERSION __DATE__ " " __TIME__\r
 \r
index aef50c68b5f0ba4542446d4eff06da65921d11cf..5bccecafde8529eb59983c6a1674d35a2a92f877 100755 (executable)
@@ -1282,3 +1282,19 @@ boolean IN_qb(byte kee)
        if(inpu.Keyboard[kee]==true) return 1;\r
        else return 0;\r
 }\r
+\r
+//init player!\r
+void IN_initplayer(player_t *player, word pn)\r
+{\r
+       player[pn].x = player[pn].tx*TILEWH;\r
+       player[pn].y = player[pn].ty*TILEWH;\r
+       player[pn].triggerx = player[pn].tx;\r
+       player[pn].triggery = player[pn].ty+1;\r
+/*     player[0].info.x = player[0].tx;\r
+       player[0].info.xaxis = player[0].tx*TILEWH;\r
+       player[0].info.y = player[0].ty;\r
+       player[0].info.yaxis = player[0].ty*TILEWH;*/\r
+       player[pn].q=1;\r
+       player[pn].d=2;\r
+       player[pn].hp=4;\r
+}\r
index 0990a55089d68ccdcf3b3cd786c7d0ab991e324c..78ebd8053db4bec143f7dc2995773c0712fd92db 100755 (executable)
@@ -303,5 +303,6 @@ extern boolean IN_UserInput(dword delay,boolean clear);
 extern boolean IN_KeyDown(byte code);\r
 extern void IN_ClearKey(byte code);\r
 extern boolean IN_qb(byte kee);\r
+void IN_initplayer(player_t *player, word pn);\r
 \r
 #endif\r
index e619bfa33338dee813a2e4483d99fddf2385e94e..39a9d614c7001c393f373107349529883374db03 100755 (executable)
@@ -189,18 +189,7 @@ void main(int argc, char *argv[])
        //default player position on the viewable map
        player[0].tx = bg->tx + bg->page->tilemidposscreenx;
        player[0].ty = bg->ty + bg->page->tilemidposscreeny;
-       player[0].x = player[0].tx*TILEWH;
-       player[0].y = player[0].ty*TILEWH;
-       player[0].triggerx = player[0].tx;
-       player[0].triggery = player[0].ty+1;
-/*     player[0].info.x = player[0].tx;
-       player[0].info.xaxis = player[0].tx*TILEWH;
-       player[0].info.y = player[0].ty;
-       player[0].info.yaxis = player[0].ty*TILEWH;*/
-       player[0].q=1;
-       player[0].d=2;
-       player[0].hp=4;
-//     player[0].persist_aniframe=0;
+       IN_initplayer(&player, 0);
        //npc
        /*npc0.tx = bg->tx + 1;
        npc0.ty = bg->ty + 1;