From 9c4ac95a4b988defb3dd98eac76b38fbf7baa762 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sun, 17 Apr 2016 16:15:32 -0500 Subject: [PATCH] wwww init player www --- src/lib/16_head.h | 1 + src/lib/16_in.c | 16 ++++++++++++++++ src/lib/16_in.h | 1 + src/scroll.c | 13 +------------ 4 files changed, 19 insertions(+), 12 deletions(-) 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; -- 2.39.5