Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
superham committed Dec 7, 2017
1 parent 19477a5 commit d13a901
Show file tree
Hide file tree
Showing 57 changed files with 616 additions and 156 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Auhtor: Dusten Knull

# Base commands, do not edit!
CC=gcc
RM=rm -rf
CP=cp

# Add all C files with full relative paths here
SRC=src/*.c

# Output EXE file, please only edit the name and no the extension
BINDIR=bin
BIN=$(BINDIR)/Game.exe

# Change to 'x86_64' if compiling on a 64-bit OS
ARCH=i386

# Include dirs for both libs and headers
LIBINCLUDES=-L$(ARCH)/SDL2/lib
INCLUDES=-I$(ARCH)/SDL2/include

# Library linker flags for SDL2
LIBS=-lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf

# Extra flags to specify how the CC command should compile our code (add -fPIC later)
FLAGS=-Wall -O2 -g3

.PHONY: all
all: clean build

.PHONY: build
build:
$(CC) $(SRC) -o $(BIN) $(FLAGS) $(INCLUDES) $(LIBINCLUDES) $(LIBS)
$(CP) $(ARCH)/SDL2/bin/*.dll $(BINDIR)

.PHONY: clean
clean:
$(RM) $(BIN)
$(RM) $(BINDIR)/*.dll

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@
Authors: Alex Kaariainen, Dusten Knull, and Ellis Archuleta
_______________________________________________________________

## About:

Darwin's Playground is an arcade-style RTS game, inspired by the mechanics of other games
such as Sid Meier's Civilization, Plague Inc., Spore, and Settlers of Catan.

In this game, you create and evolve a species over time to make them grow and survive in their environment. As the species' populatioon grows, it's population will spread throughout the surrounding regions as well. You must continue to balance the species' traits and evolutionary status so that it may survive and thrive as it spreads and becomes dominant over the land.
_______________________________________________________________

## Build instructions:

For Windows:
- In a MinGW terminal, cd to the 'Windows' directory in the root folder of this project
- On a 32-bit OS, simply run 'make all' or just 'make'
- On a 64-bit OS, run 'make all_64'

For Linux:
- In a unix terminal, cd to the 'Linux' directory
- Run the configure script provided via './configure.sh'. This script utilizes the 'apt-get' command, so if your system does not
support the apt package manager, you will have to manually install the packages specifed using your system's package manager
- After you have successfully installed the required packages, simply run 'make all' or just 'make'
_______________________________________________________________
Binary file added bin/Game.exe
Binary file not shown.
Binary file added bin/SDL2.dll
Binary file not shown.
Binary file added bin/SDL2_image.dll
Binary file not shown.
Binary file added bin/SDL2_ttf.dll
Binary file not shown.
Binary file added bin/libfreetype-6.dll
Binary file not shown.
Binary file added bin/libjpeg-9.dll
Binary file not shown.
Binary file added bin/libpng16-16.dll
Binary file not shown.
Binary file added bin/libtiff-5.dll
Binary file not shown.
Binary file added bin/libwebp-7.dll
Binary file not shown.
Binary file added bin/resources/Thumbs.db
Binary file not shown.
Binary file added bin/resources/bone_spikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/dexbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/dumb_muscle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/exoskeleton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/extra_stomach.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/fertility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/greenarrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/hard_shell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/hills00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/improved_foraging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/increased_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/insomniac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/iron_grip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/longevity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/natural_camoflauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/night_vision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/olfactory_acuity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/opposable_thumbs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/powerful_hind_legs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/prehensile_tail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/redarrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/resbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/small_frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/strbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/strong_jaw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources/tail.png
Binary file added bin/resources/tenbutton.png
Binary file added bin/resources/thick_fur.png
Binary file added bin/resources/tough_claws.png
Binary file added bin/resources/water_reserves.png
Binary file added bin/resources/wolf_pack_tactics.png
Binary file added bin/zlib1 (2).dll
Binary file not shown.
Binary file added bin/zlib1.dll
Binary file not shown.
54 changes: 51 additions & 3 deletions src/Evolve.c
Original file line number Diff line number Diff line change
@@ -1,25 +1,73 @@
#include "Evolve.h"
void Evolve_init(Evolve* evolve, SDL_Renderer* renderer, const char* texfile, int dstr, int ddex, int dten, int dres, int dhot, int dcold, int darid, int dmount, int dforest)

//Evolution initilaztion function
void Evolve_init(Evolve* evolve, SDL_Renderer* renderer, const char* texfile, int dstr, int ddex, int dten, int dres, int dhot, int dcold, int darid, int dmount, int dforest, int dfertility, int dlifespan, int cost)
{
Square_create(&(evolve->square), renderer, texfile, 0, 0, EVOLVE_TILE_SIZE, EVOLVE_TILE_SIZE);
Textbox_init(&(evolve->textbox), "", EVOLVE_TILE_SIZE + 30, EVOLVE_TILE_SIZE / 2, EVOLVE_TILE_SIZE + 16, (EVOLVE_TILE_SIZE / 2) - 14);
evolve->textbox.boxcolor = EVOLVE_LABEL_COLOR;

evolve->d_str = dstr;
evolve->d_dex = ddex;
evolve->d_ten = dten;
evolve->d_res = dres;
evolve->d_hot = dhot;

evolve->d_cold = dcold;
evolve->d_arid = darid;
evolve->d_mount = dmount;
evolve->d_forest = dforest;
evolve->d_fertility = dfertility;
evolve->d_lifespan = dlifespan;

evolve->applied = 0;
evolve->evo_cost = cost;
}
void Evolve_trait(Evolve* evolve, Species* species)


void Evolve_trait(Evolve* evolve, Species* species)//applies bonuses from traits to species
{
Species_growRelative(species, evolve->d_str, evolve->d_dex, evolve->d_ten, evolve->d_res);

species->d_hot += evolve->d_hot;
species->d_cold += evolve->d_cold;
species->d_arid += evolve->d_arid;
species->d_mount += evolve->d_mount;
species->d_forest += evolve->d_forest;
species->fertility += evolve->d_fertility;
species->lifespan+= evolve->d_lifespan;


species->evo_points -= evolve->evo_cost;

evolve->applied = 1;
}

void Evolve_moveTo(Evolve* evolve, int x, int y)//moves physical evolution location
{
evolve->square.bounds.x = x;
evolve->square.bounds.y = y;

evolve->textbox.bounds.x = x - 15;
evolve->textbox.bounds.y = y - evolve->textbox.bounds.h;
}

void Evolve_hideDescription(Evolve* evolve)//hides evolution popup
{
evolve->textbox.visible = 0;
}

void Evolve_setDescription(Evolve* evolve, const char* title)//sets evolution desc.
{
Textbox_setText(&(evolve->textbox), (char*)title, 0);
}

void Evolve_render(Evolve* evolve, SDL_Renderer* renderer, TTF_Font* font)//renders evolution text
{
Textbox_render(&(evolve->textbox), renderer, font);
SDL_RenderCopy(renderer, evolve->square.texture, NULL, &(evolve->square.bounds));
}

void Evolve_destroy(Evolve* evolve)//removes evolve txt
{
Square_destroy(&(evolve->square));
}
51 changes: 40 additions & 11 deletions src/Evolve.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
#ifndef GAME_EVOLVE_H_
#define GAME_EVOLVE_H_
#define EVOLVE_TILE_SIZE 60
#include "Square.h"
#include "Species.h"

#include <SDL2/SDL.h>

#if defined(__APPLE__)
#include <SDL2_ttf/SDL_ttf.h>
#else
#include <SDL2/SDL_ttf.h>
#endif

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef struct {

#include "Square.h"
#include "Species.h"
#include "Textbox.h"

#define EVOLVE_TILE_SIZE 75
#define EVOLVE_LABEL_COLOR 0x73555555

typedef struct {//evolution structure

Textbox textbox;
Square square;
//attribute modifiers

unsigned applied;

int d_str;
int d_dex;
int d_ten;
int d_res;

//independent modifiers

int d_cold;
int d_hot;
int d_arid;
int d_mount;
int d_forest;
int d_fertility;
int d_lifespan;
int evo_cost;
} Evolve;

void Evolve_init(Evolve*, SDL_Renderer*, const char*, int, int, int, int, int, int, int, int, int, int, int, int);
void Evolve_trait(Evolve*, Species*);

void Evolve_moveTo(Evolve*, int, int);

void Evolve_hideDescription(Evolve*);
void Evolve_setDescription(Evolve*, const char*);

void Evolve_render(Evolve*, SDL_Renderer*, TTF_Font*);
void Evolve_destroy(Evolve*);

}Evolve;
void Evolve_init(Evolve* evolve, SDL_Renderer* renderer, const char* texfile, int dstr, int ddex, int dten, int dres, int dhot, int dcold, int darid, int dmount, int dforest);
void Evolve_trait(Evolve *evolve, Species *species);
#endif /*GAME_EVOLVE_H_*/
#endif /*GAME_EVOLVE_H_*/
Loading

0 comments on commit d13a901

Please sign in to comment.