Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jepemo/open-pvz
Tower Defense Game Engine inspired by "Plantz Vz Zombiez", implemented in C with differents bindings for other languages.
https://github.com/jepemo/open-pvz
binding c game-engine lua tower-defense
Last synced: 17 days ago
JSON representation
Tower Defense Game Engine inspired by "Plantz Vz Zombiez", implemented in C with differents bindings for other languages.
- Host: GitHub
- URL: https://github.com/jepemo/open-pvz
- Owner: jepemo
- License: gpl-3.0
- Created: 2017-05-12T13:56:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-14T18:50:53.000Z (almost 7 years ago)
- Last Synced: 2024-10-23T20:14:40.415Z (2 months ago)
- Topics: binding, c, game-engine, lua, tower-defense
- Language: C
- Homepage:
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# open-pvz
Tower Defense Game Engine inspired by "Plantz Vz Zombiez", implemented in C with differents bindings for other languages.- [Getting Started](#getting-started)
- [Example](#example)
- [Bindings](#bindings)## Getting Started
### Build & Install
In **Linux** (Ubuntu)
Install compiler and lua headers
```bash
apt-get install gcc
```
In **Mac OS**
Install [brew](https://brew.sh/)Install lua:
```bash
brew install lua```
**Get** the sourcecode:
```
git clone https://github.com/jepemo/open-pvz.git
```**Build** library, executing the make command:
```
cd open-pvz
make
```## Example
### C Simple level example
```c
#include "opvz.h"void level_init (Level *level)
{
// plants
level_add_entity(level, PLANT_SUNFLOWER, 0, 0);
level_add_entity(level, PLANT_SUNFLOWER, 0, 1);
level_add_entity(level, PLANT_SUNFLOWER, 0, 2);
level_add_entity(level, PLANT_SUNFLOWER, 0, 3);
level_add_entity(level, PLANT_SUNFLOWER, 0, 4);level_add_entity(level, PLANT_PEASHOOTER, 1, 0);
level_add_entity(level, PLANT_PEASHOOTER, 1, 1);
level_add_entity(level, PLANT_PEASHOOTER, 1, 2);
level_add_entity(level, PLANT_PEASHOOTER, 1, 3);
level_add_entity(level, PLANT_PEASHOOTER, 1, 4);// Zombies
level_add_entity(level, ZOMBIE_REGULAR, 8, 0);
level_add_entity(level, ZOMBIE_REGULAR, 8, 1);
level_add_entity(level, ZOMBIE_REGULAR, 8, 2);
level_add_entity(level, ZOMBIE_REGULAR, 8, 3);
level_add_entity(level, ZOMBIE_REGULAR, 8, 4);
}int main (int argc, char **argv)
{
Level *level = level_new_default();level_init(level);
bool finished = false;
while(!finished) {
level_print_debug(level);LevelStatus * status = level_step(level);
finished = status->finished;
}level_destroy(level);
return 0;
}
```### Output:
![C Program animation](doc/c_anim.gif)
## Bindings:
* Lua ([Documentation](doc/lua.md))
* Java (Todo)