Files

32 lines
961 B
C

#ifndef ISLANDS_H
#define ISLANDS_H
#include "engineSprite.h"
#include <raylib.h>
#define MAX_ISLANDS 14
// Perimeter samples used to build each island's procedural shape (see
// GenerateIsland in appGameIslands.c). Higher than you'd need for the old
// small islands since they're now rendered at much higher native resolution
// and a coarser sample count would show as flat facets on the coastline.
#define ISLAND_SHAPE_POINTS 28
typedef struct {
Vector2 position;
float radius; // collision radius (outer shore edge), in world units
Sprite sprite; // a small procedurally-painted texture, point-filtered like
// the rest of the cast, not a shader effect
} Island;
typedef struct {
int count;
Island island[MAX_ISLANDS];
} Islands;
Islands CreateIslands(Camera2D *camera);
void UpdateIslands(Islands *islands, Camera2D *camera);
void RenderIslands(Islands *islands);
void UnloadIslands(Islands *islands);
#endif // ISLANDS_H