mobs.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MOBS_H
00019 #define MOBS_H
00020 #include <SDL/SDL.h>
00021 #include <stdlib.h>
00022 #include <libguile.h>
00023 #include "sequence.h"
00024 #include "constants.h"
00025 #include "event.h"
00026
00027 typedef struct
00028 {
00029 int x;
00030 int y;
00031 int grid;
00032 float xpixelalignment;
00033 float ypixelalignment;
00034 int imgindex;
00035 unsigned int animation;
00036 unsigned int frame;
00037 unsigned int targetframe;
00038 char animlooping;
00039 char resetonnext;
00040 int initialtimetonextframe;
00041 int timetonextframe;
00042 int xmoverate;
00043 int xmoveamount;
00044 int ymoverate;
00045 int ymoveamount;
00046 SCM userdata;
00047 sequence move_descriptors;
00048 eventstack events;
00049 } mob;
00050
00051 typedef struct
00052 {
00053 int tilex, tiley, frames;
00054 } move_descriptor;
00055
00056 extern sequence mobs;
00057
00058 void mobs_init(void);
00059 mob create_mob_using_sprite (unsigned int, unsigned int,unsigned grid, char *);
00060 int push_mob_on_array (mob);
00061 void remove_mob(int);
00062 void mob_set_animation_by_index(int ind, unsigned int animation, unsigned int startframe, unsigned int targetframe, unsigned int framesperframe, char looping);
00063 void animate_mobs();
00064 void move_mobs();
00065 void mob_move_all_by_index(int ind, int xtiles, int ytiles, int frames);
00066 void mob_add_movement_by_index(int ind, int xtiles, int ytiles, int frames);
00067 void mob_stop_animation_by_index(int ind);
00068 void set_mob_frame_by_index(int ind,unsigned int animation,unsigned int framenum);
00069 void set_mob_userdata_by_index(int ind, SCM newdata);
00070 char set_mob_position_by_index(int ind, int x, int y, int g);
00071 mob* get_mob_by_index(int ind);
00072 void stop_mob_movement_by_index(int ind);
00073
00074
00075 #include "tile.h"
00076 #endif