-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
616 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_*/ |
Oops, something went wrong.