From: sparky4 Date: Sun, 17 Apr 2016 21:15:32 +0000 (-0500) Subject: wwww init player www X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=9c4ac95a4b988defb3dd98eac76b38fbf7baa762 wwww init player www --- diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 3217ea2e..4b9972f1 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -50,6 +50,7 @@ #include "src/lib/nyan/kitten.h" #include "src/lib/types.h" #include "src/lib/typdefst.h" +#include "src/lib/16_in.h" #define VERSION __DATE__ " " __TIME__ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index aef50c68..5bccecaf 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -1282,3 +1282,19 @@ boolean IN_qb(byte kee) if(inpu.Keyboard[kee]==true) return 1; else return 0; } + +//init player! +void IN_initplayer(player_t *player, word pn) +{ + player[pn].x = player[pn].tx*TILEWH; + player[pn].y = player[pn].ty*TILEWH; + player[pn].triggerx = player[pn].tx; + player[pn].triggery = player[pn].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[pn].q=1; + player[pn].d=2; + player[pn].hp=4; +} diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 0990a550..78ebd805 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -303,5 +303,6 @@ extern boolean IN_UserInput(dword delay,boolean clear); extern boolean IN_KeyDown(byte code); extern void IN_ClearKey(byte code); extern boolean IN_qb(byte kee); +void IN_initplayer(player_t *player, word pn); #endif diff --git a/src/scroll.c b/src/scroll.c index e619bfa3..39a9d614 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -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;