c2e.convert_special: 0
e2c.convert_num: 0
openfiles: /dos/z/16/doc/project.txt:102:0:0:
-openfiles: /dos/z/16/scroll.c:0:2959:1:
+openfiles: /dos/z/16/scroll.c:12437:11784:1:
openfiles: /dos/z/16/modex16.c:9475:0:0:
openfiles: /dos/z/16/modex16.h:1512:344:0:
openfiles: /dos/z/16/pcxtest.c:1339:442:0:
opendir: file:///dos/z/16/lib
wrap_text_default: 0
bookmarks_filename_mode: 1
-ssearch_text: )*2
+ssearch_text: inc_
snr_casesens: 1
view_blocks: 1
name: project 16
-replacelist: animatePlayer(spri
-replacelist: modexDrawSpriteRegion(spri
-replacelist: spri->page = modexDefaultPage();
replacelist: screen2=modexNextPage(mv.page);
replacelist: spri->page=draw->page;
replacelist: mv
replacelist: bg
replacelist: dest
replacelist: animatePlayer(bg, spri,
+replacelist: qi=1
+replacelist: qi<=(
+replacelist: \t\t\t\t
fb_show_hidden_f: 0
editor_tab_width: 4
show_visible_spacing: 1
recent_files: file:///dos/z/16/16/modex16/dos_kb.h
recent_files: file:///dos/z/16/doc/16.16
recent_files: file:///dos/z/16/doc/16story.txt
-recent_files: file:///dos/z/16/scroll.c
recent_files: file:///dos/z/16/doc/project.txt
-recent_files: file:///dos/z/16/modex16.h
-recent_files: file:///dos/z/16/pcxtest.c
-recent_files: file:///dos/z/16/dos_kb.c
recent_files: file:///dos/z/16/dos_kb.h
recent_files: file:///dos/z/16/lib/lib_head.h
+recent_files: file:///dos/z/16/dos_kb.c
+recent_files: file:///dos/z/16/modex16.h
+recent_files: file:///dos/z/16/pcxtest.c
recent_files: file:///dos/z/16/modex16.c
+recent_files: file:///dos/z/16/scroll.c
snr_replacetype: 0
savedir: file:///dos/z/16
spell_check_default: 1
htmlbar_view: 0
spell_lang: en
ssearch_dotmatchall: 0
-searchlist: wPage(draw
-searchlist: 32);
-searchlist: 33)
-searchlist: 3)
searchlist: draw
searchlist: 34)
searchlist: 0x3DA
searchlist: modexDrawSpriteRegion
searchlist: bg
searchlist: )*-
+searchlist: qi=0
+searchlist: qi<(
+searchlist:
searchlist: )*2
+searchlist: inc_
autocomplete: 1
outputb_show_all_output: 0
bookmarks_show_mode: 0
void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);
void mapDrawRow(map_view_t *mv, int tx, int ty, word y);
void mapDrawCol(map_view_t *mv, int tx, int ty, word x);
-void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, bitmap_t *bmp);
+void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp);
#define TILEWH 16
#define QUADWH (TILEWH/4)
void main() {
bitmap_t ptmp; // player sprite
int q=1;
+ static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */
page_t screen, screen2;
map_t map;
map_view_t mv, mv2;
//to stop scrolling and have the player position data move to the edge of the screen with respect to the direction
//when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map
- //TODO: render the player properly with animation and sprite sheet
- //TODO: fexible speeds
+ #define INC_PER_FRAME if(q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1;
+
if(keyp(77) && !keyp(75))
{
if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10)
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
- animatePlayer(bg, spri, 1, 1, player.x, player.y, q, &ptmp);
+ INC_PER_FRAME;
+ animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp);
mapScrollRight(bg, SPEED);
mapScrollRight(spri, SPEED);
modexShowPage(spri->page);
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
+ INC_PER_FRAME;
player.x+=SPEED;
- animatePlayer(bg, spri, 1, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(bg, spri, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp);
modexShowPage(spri->page);
}
player.tx++;
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
-
- animatePlayer(bg, spri, 3, 1, player.x, player.y, q, &ptmp);
+ INC_PER_FRAME;
+ animatePlayer(bg, spri, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp);
mapScrollLeft(bg, SPEED);
mapScrollLeft(spri, SPEED);
modexShowPage(spri->page);
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
+ INC_PER_FRAME;
player.x-=SPEED;
- animatePlayer(bg, spri, 3, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(bg, spri, 3, 0, player.x, player.y, persist_aniframe, q, &ptmp);
modexShowPage(spri->page);
}
player.tx--;
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
- animatePlayer(bg, spri, 2, 1, player.x, player.y, q, &ptmp);
+ INC_PER_FRAME;
+ animatePlayer(bg, spri, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp);
mapScrollDown(bg, SPEED);
mapScrollDown(spri, SPEED);
modexShowPage(spri->page);
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
+ INC_PER_FRAME;
player.y+=SPEED;
- animatePlayer(bg, spri, 2, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(bg, spri, 2, 0, player.x, player.y, persist_aniframe, q, &ptmp);
modexShowPage(spri->page);
}
player.ty++;
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
- animatePlayer(bg, spri, 0, 1, player.x, player.y, q, &ptmp);
+ INC_PER_FRAME;
+ animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp);
mapScrollUp(bg, SPEED);
mapScrollUp(spri, SPEED);
modexShowPage(spri->page);
{
for(q=1; q<=(TILEWH/SPEED); q++)
{
+ INC_PER_FRAME;
player.y-=SPEED;
- animatePlayer(bg, spri, 0, 0, player.x, player.y, q, &ptmp);
+ animatePlayer(bg, spri, 0, 0, player.x, player.y, persist_aniframe, q, &ptmp);
modexShowPage(spri->page);
}
player.ty--;
}
void
-animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, bitmap_t *bmp)
+animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp)
{
short dire=32*d1;
short qq;
- short lo = ((TILEWH / SPEED) / 3);
- short loo = (ls + lo);
if(d2==0) qq = 0;
- else qq = ((ls)*SPEED);
+ else qq = ((lp)*SPEED);
switch (d1)
{
case 0: