aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-11-06 08:48:46 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-11-06 08:48:46 -0500
commite257d84daee9d474a944588214fbdafed9d9e983 (patch)
treefcbd3d8e7cbaad994c0ab20793b3ae86903b7451 /src
parentcb55d6e72ae1f48622ffc2a36d7bdb3719355afe (diff)
Fixed some handAngle bugs, and raised the world height
Diffstat (limited to 'src')
-rw-r--r--src/gameplay.cpp6
-rw-r--r--src/ui.cpp9
-rw-r--r--src/world.cpp7
3 files changed, 13 insertions, 9 deletions
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index b32d9ee..39d0675 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -40,7 +40,7 @@ void initEverything(void){
* Load the saved world if it exists, otherwise generate a new one.
*/
- FILE *worldLoad;
+ /*FILE *worldLoad;
if((worldLoad=fopen("world.dat","r"))){
std::cout<<"Yes"<<std::endl;
char *buf;
@@ -51,10 +51,10 @@ void initEverything(void){
buf=(char *)malloc(size);
fread(buf,1,size,worldLoad);
test->load(buf);
- }else{
+ }else{*/
test->generate(SCREEN_WIDTH * 2);
test->addHole(100,150);
- }
+ //}
test->addLayer(400);
diff --git a/src/ui.cpp b/src/ui.cpp
index 7329f6a..237d09a 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -150,9 +150,9 @@ namespace ui {
memset(ret,0,512);
size=strlen(str);
linc=0;
- sinc=2;
+ sinc=1;
}
- if(++sinc==3){
+ if(++sinc==2){
sinc=0;
strncpy(ret+linc,str+linc,1);
if(linc<size)linc++;
@@ -315,6 +315,8 @@ namespace ui {
if(SDL_KEY==SDLK_p)toggleBlack();
if(SDL_KEY==SDLK_F3)debug^=true;
if(SDL_KEY==SDLK_b & SDL_KEY==SDLK_F3)posFlag^=true;
+ if(SDL_KEY==SDLK_UP)handAngle++;
+ if(SDL_KEY==SDLK_DOWN)handAngle--;
break;
/*
KEYUP
@@ -327,6 +329,9 @@ namespace ui {
if(SDL_KEY==SDLK_LCTRL)player->speed = 1;
if(SDL_KEY==SDLK_h)player->health-=5;
if(SDL_KEY==SDLK_f)player->light ^= true;
+ if(SDL_KEY==SDLK_UP)handAngle+=0;
+ if(SDL_KEY==SDLK_DOWN)handAngle-=0;
+
break;
default:
break;
diff --git a/src/world.cpp b/src/world.cpp
index 01c06c4..b0f419d 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -7,11 +7,11 @@
// or not calculated at all, so GEN_INC is also used to decrease 'lineCount' in functions like draw()
// and detect().
-#define GEN_MIN 40
-#define GEN_MAX 70
+#define GEN_MIN 80
+#define GEN_MAX 110
#define GEN_INIT 60
-#define GRASS_HEIGHT 4 // Defines how long the grass layer of a line should be in multiples of HLINE.
+#define GRASS_HEIGHT 4 // Defines how long the grass layer of a line should be in multiples of HLINE.
#define DRAW_Y_OFFSET 50 // Defines how many pixels each layer should be offset from each other on the y axis when drawn.
@@ -56,7 +56,6 @@ char *World::save(unsigned int *ssize){
void World::load(char *buf){
struct wSavePack *sp;
sp=(struct wSavePack *)buf;
- std::cout<<sp->lineCount<<std::endl;
x_start=sp->x_start;
lineCount=sp->lineCount;
line=(struct line_t *)calloc(lineCount,sizeof(struct line_t));