Actors * actors_new(void) {
    Actors * self;
    land_alloc(self);
    self->array = land_array_new();
    self->w = 64;
    self->h = 12;
    self->tilemap = land_calloc(self->w * self->h * sizeof * self->tilemap);
    return self;
}
示例#2
0
Overview* overview_new(void) {
    Overview * self;
#line 17
    land_alloc(self);
#line 19
    self->zoom = 0;
#line 21
    for (int i = 1; i < 50; i += 1) {
        self->update [i] = 1;
    }
    return self;
}
示例#3
0
BlockType* blocktype_new(char const * name, float xs, float ys, float zs, void(* tick)(Block *), void(* touch)(Block *, Block *, float, float, float), void(* destroy)(Block *), Block * (* allocate)(void), void(* post_init)(Block *)) {
    BlockType * self;
    land_alloc(self);
    self->name = land_strdup(name);
    self->xs = xs;
    self->ys = ys;
    self->zs = zs;
    self->dynamic = 0;
    self->lift = 0;
    self->transparent = 0;
    self->tick = tick;
    self->touch = touch;
    self->destroy = destroy;
    self->allocate = allocate;
    self->post_init = post_init;
    return self;
}
Actor * actor_new(Actors * actors, float x, float y, int type_id) {
    if (! actor_type[type_id]) {
        return NULL;
    }
    Actor * self;
    land_alloc(self);
    self->kind = actor_type[type_id];
    self->hp = self->max_hp = self->kind->initial_hp;
    self->damage = self->kind->initial_damage;
    self->angle = land_rnd(0, 2 * pi);
    self->x = x;
    self->y = y;
    self->tx = x;
    self->ty = y;
    self->id = 1 + land_array_count(actors->array);
    land_array_add(actors->array, self);
    actor_place(self);
    return self;
}
示例#5
0
int my_main(void) {
    All * a;
    land_alloc(a);
#line 291
    int w = 960;
    int h = 600;
    a->show_help = 1;
#line 295
    land_init();
#line 297
    main_data_path = land_strdup(".");
#line 299
    if (land_argc > 1) {
        if (land_equals(land_argv [1], "test")) {
            return test();
        }
    }
    //land_set_display_parameters(w, h, LAND_OPENGL)
#line 304
    #ifdef ANDROID
#line 306
    land_set_display_parameters(0, 0, LAND_FULLSCREEN | LAND_DEPTH | LAND_LANDSCAPE);
#line 306
    #else
#line 308
    land_set_display_parameters(w, h, LAND_DEPTH | LAND_RESIZE);
#line 308
    #endif
#line 316
    LandRunner * game_runner = land_runner_new("Yellow and Dangerous", runner_init, NULL, runner_update, runner_redraw, NULL, runner_done);
    a->w = w;
    a->h = h;
#line 320
    land_runner_register(game_runner);
    land_set_initial_runner(game_runner);
    land_mainloop();
#line 324
    land_free(main_data_path);
    land_free(a);
#line 327
    return 0;
}
示例#6
0
Block* gremlin_allocate(void) {
    Gremlin * self;
    land_alloc(self);
    self->respect = 60;
    return & self->super;
}
示例#7
0
Block* allefant_allocate(void) {
    Allefant * self;
    land_alloc(self);
    return & self->super;
}