This commit is contained in:
olikraus 2017-07-09 16:13:08 +02:00
parent 5666691392
commit a47835a895
6 changed files with 71 additions and 1 deletions

View File

@ -228,6 +228,12 @@ const uint8_t scrollosprites[6642] U8G2_FONT_SECTION("scrollosprites") =
#define MAP_DISPLAY_WIDTH 8
#define MAP_DISPLAY_HEIGHT 4
/*===============================================*/
/*===============================================*/
u8g2_t u8g2;
void map_draw(uint8_t map_idx, uint8_t x0, uint8_t y0)

View File

@ -6,6 +6,42 @@
# tile <ascii> <mapto> <top> <right> <bottom> <left>
# map the <ascii> code to the specified <mapto> code, if the other for tiles match
# If one of the other four tiles is 0, then ignore this tile (wildcard)
# thing ... same as tile, but can be redefined at any time, should redefine to char
#
# item <iname> <backgroundmapto> <foregroundmapto>
# defines a global template for an object.
# anyting on the map, which might disappear, move or change has to be an item
# itemuse <iname> <ascii>
# only within active map. <mapto> will be the background tile for the char
# the current foreground tile might still be differrent and is set during iteminit
# connects the ascii char with the given ascii char on the map to get the xy pos.
# iteminit <iname>
# <procedure>
# endproc
# procedure, which is called, when the item is created,
# receives position, where it should be created on the map
# itemhit <iname>
# procedure, which is called, when the item is hit by something
# - returns 0 if the item hitting item has to be stopped
# - may move itself
# - may change its own shape (tile)
# - may modify its status
# endproc
#
# example "normal door, status=closed"
# 1. hit: status=open, change tile to open door, return 0
# 2. hit: return 1 (hero can pass)
# example "creature, status=5 life"
# 1. hit: get hitting obj attac damage, reduce life --> status=2, apply attack damage hitting object, return 0
# 2. hit: get hitting obj attac damage, reduce life --> status=0, remove object from map, return 0
# 3. hero can continue
#
# itemstep <iname>
# executed every step
# - moving items can move towards hero or others
# enditemstep
#
#
# map <name> <width> <height>
# Create a map with the given name and size. this must be followed by :
# endmap

View File

@ -35,9 +35,11 @@ void ugl_SetLabelBytecodePos(const char *name, uint16_t bytecode_pos);
uint16_t ugl_GetLabelBytecodePos(int idx);
/* ugl_file.c */
/* ugl_parse.c */
extern int ugl_current_input_line;
int ugl_read_line(const char **s);
int ugl_read_fp(void);
int ugl_read_filename(const char *name);

View File

@ -1,7 +1,28 @@
/*
ugl_bc.c
items can be at three places
1) map
2) inventory
3) hero
map --> inventory take
inventory --> map drop
inventory --> hero equip
hero --> inventory unequip
hero --> map drop
inputs:
hDir() // direction into which the hero wants to walk, had waked or looks
iDir() // direction into which the item/creatue/missel wants to go, went or looks
hX() // hero X position
hY() // hero Y position
posByH // set current position to the position of the hero
posByI // set current position to the position of the current item
posAppyDir(dir) // change the possition going one step into the specified direction
*/
#include "ugl_bc.h"
@ -270,6 +291,8 @@ void bc_exec(bc_t *bc, uint8_t *code)
}
/*======================================================*/
/* put top of stack into register a, reduce stack */

View File

@ -79,4 +79,7 @@ extern bc_buildin_fn bc_buildin_list[];
void bc_exec(bc_t *bc, uint8_t *code);
/*======================================================*/
#endif