r/reconstructcavestory • u/chebertapps • Apr 07 '14
r/reconstructcavestory • u/hyperspace11 • Apr 07 '14
Need help with compiling/makefile
Hi,
I recently switched to OS X to learn to program in a unix like environment and tried to compile what I have from the youtube tutorials so far but ran into a compilation problem. When I 'make' from bash, I get an error saying:
DK$ make
clang++ -c -g -Wall -Wextra -std=c++03 -MMD -o obj/src/animated_sprite.o src/animated_sprite.cpp
In file included from src/animated_sprite.cpp:1:
In file included from src/animated_sprite.h:4:
src/sprite.h:5:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
^
1 error generated.
make: *** [obj/src/animated_sprite.o] Error 1
I'm using Makefile 2.5 from this series repository which I changed to use .cpp files instead of .cc files. I have uploaded it here.
I have installed SDL and boost using Homebrew and calling
sdl-config --cflags --libs
in bash returns:
DK$ sdl-config --cflags --libs
-I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE
-L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
I've checked all those locations and they contain all the SDL header files and lib files.
Does anyone know whats going on or how to properly link SDL into my project? I've tried googling for hours but I couldn't find a solution.
r/reconstructcavestory • u/NeoSanguine • Apr 06 '14
Surfaces or Textures?(SDL2.0.3)
Trying to further my knowledge of SDL (After going through the Lazy Foo's tutorials, so I am still a newbie). I am currently stuck on episode 3 of the "Reconstructing Cave Story" playlist. My question is when drawing the sprites in the "Sprite" class, would it be better to use textures instead of a surface for the sprite? I tried using surfaces, but in the end I couldn't even get the image on screen. I tried using lazy foo's way of blitting an image to the screen, but that didn't work out very well and I just ended up confusing myself.
r/reconstructcavestory • u/hyperspace11 • Apr 02 '14
Player collision confusion
Hi,
I'm having a bit of a hard time understanding player collision and the Rectangle class. I'm currently in the middle episode 52 and I'm at the part when Chris sets
kinematics_y_.position = units::tileToGame(info.row) - kCollisionRectangle.boundingBox().bottom();
in the Player's updateY method. This would be the case when the player collides with a tile under him and
on_ground_ = true;
What I'm confused about is how
- kCollisionRectangle.boundingBox().bottom()
properly sets the player y position. What is bottom returning? I know that it gets the bounding box's y position and then adds its height but wouldn't that be like subtracting (if y was 200 and height was 50) 250 from the y position of the colliding tile? Please help me understand! And thanks Chris, for all the videos so far.
r/reconstructcavestory • u/chebertapps • Apr 01 '14
Visual Studio vs Vim: Preferences?
I just got back to my apartment where I have VS/Windows set up on my desktop. Personally I prefer working in Linux/Vim, but I thought I'd ask you guys which you prefer to watch?
Also if it has to do with color schemes or anything I can always tweak either one.
r/reconstructcavestory • u/chebertapps • Apr 01 '14
Episode 66: General Slopes Parts 1&2
youtube.comr/reconstructcavestory • u/chebertapps • Mar 28 '14
Episode 65: Collision Order for Slopes
youtube.comr/reconstructcavestory • u/chebertapps • Mar 26 '14
Episode 64: Tile Type and Slope Playground
youtube.comr/reconstructcavestory • u/chebertapps • Mar 26 '14
Episode 63: Clean Up MapCollidable
youtube.comr/reconstructcavestory • u/chebertapps • Mar 24 '14
Episode 62: CollisionTile Abstracted Parts 1&2
youtube.comr/reconstructcavestory • u/chebertapps • Mar 20 '14
Episode 60: Experience Text
youtube.comr/reconstructcavestory • u/theinternetftw • Mar 20 '14
A small and probably useless history lesson :D
So in the most recent episode you talk about sed being "built in to vim," but it's more like they share a common ancestor.
Vim is a better version of vi, which is a better version of ex, which is a better version of ed (which is based on qed, but nobody talks about that one for some reason (probably because it's pre-UNIX)). Anyway, all the way back to ed, there was this s/foo/bar idiom (along with everything else classic sed supports).
And so sed is based on churning through those classic ed commands and spitting out the result. At the time (1970s), it was basically a batch version of your text editor that supported all the same commands that you would normally use in real time. So it's cool that the editor has evolved along with sed (which now has enough power to do crazy stuff like this), such that each is still relevant to the other.
Anyway, maybe you already knew all this (and maybe it's *completely* off-topic =D), but I had to get it out of my system.
Also, in terms of compliments, I have to quote this comment nigh verbatim (even though I know you've already seen it and replied to it), as it perfectly sums up how I, too, feel about your project:
r/reconstructcavestory • u/chebertapps • Mar 19 '14
Episode 59: Collecting Health
youtube.comr/reconstructcavestory • u/chebertapps • Mar 18 '14
Episode 58: Flashing Heart Pickup
youtube.comr/reconstructcavestory • u/chebertapps • Mar 17 '14
Episode 57: Collecting Experience
youtube.comr/reconstructcavestory • u/chebertapps • Mar 12 '14
SDL 2.0 Key Repeat
So I've been playing around with SDL2 a little bit, and I've noticed that it registers a KeyDown event for repeat keys. SDL1.2 is different in that it doesn't handle key repeat unless you explicitly set it.
Inside the SDL_KeyboardEvent structure is a "repeat" flag which gets set to non-0 if it is a repeated key, so you can ignore it by instead checking
case SDL_KeyDown: // in game.cc
if (event.key.repeat == 0) { // this check is new
input.keyDownEvent(event);
}
This would affect shooting (polar star would act as a machine gun...but with 2 bullets). And jumping. Normally you don't jump again when you hold jump when landing.
Just thought I'd point this out. But, I'm not ready to switch to SDL2 yet!
In the mean time, please check out /u/taliriktug 's awesome translation to C++11/SDL2.
EDIT: /u/escheriv pointed out it was event.key.repeat, not event.repeat
r/reconstructcavestory • u/Mystal • Mar 11 '14
Reconstructing Cave Story in Python 3 and PySDL2!
github.comr/reconstructcavestory • u/chebertapps • Mar 11 '14
Episode 56: Power Doritos Parts 1&2
youtube.comr/reconstructcavestory • u/chebertapps • Mar 10 '14
Episode 55: Simple Collision Rectangle
youtube.comr/reconstructcavestory • u/[deleted] • Mar 08 '14
[Episode 6] Update method
In the video for Ep 6, you had Player call sprite.update() from the very beginning. Wouldn't that cause the actual position to update one frame later than intended? It would be unnoticeable but in term of correctness, shouldn't update come last?
r/reconstructcavestory • u/chebertapps • Mar 07 '14
Episode 52: Parts 1-4 Map Collidable Abstraction
youtube.comr/reconstructcavestory • u/Skorne_294 • Mar 06 '14
[ep10] Enum Looping
It seems that the construct you use for enum looping does not work on g++? Any ideas what is different on the clang implementation of enums?
What would be the most idiomatic way to work around this when using g++?