From: Gwyn Ciesla Date: Wed, 24 Sep 2014 17:27:21 +0000 (-0500) Subject: SDL2 X-Git-Tag: 1.11~1 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=ca7ca768a53bb983613381bdedd8554bb07f79dd;p=curblaster.git SDL2 AppData --- diff --git a/CHANGELOG b/CHANGELOG index 8baec20..7adf2c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +Migrated to SDL2. +Added AppData. Additional points for high altitude pod grabs, and lander snatches. Shields defanged, super shield powerup gives killer shields. Landers/crazies and crawlers are scaled as levels increase. diff --git a/Makefile b/Makefile index 3001fdd..84def90 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ INST = /usr/local/bin main: main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o - g++ $(CFLAGS) -o curblaster main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o -lncurses -lSDL -lSDL_mixer + g++ $(CFLAGS) -o curblaster main.o check_collision.o age_bullet.o gravitize.o radar_plot.o object_out.o motion.o init.o draw.o powerup.o play_sound_effect.o mishaps.o enemy_shoot.o -lncurses -lSDL2 -lSDL2_mixer main.o: main.cpp $(CXX) -c main.cpp check_collision.o: check_collision.cpp check_collision.h diff --git a/curblaster.appdata.xml b/curblaster.appdata.xml new file mode 100644 index 0000000..bc85c5a --- /dev/null +++ b/curblaster.appdata.xml @@ -0,0 +1,15 @@ + + + + + curblaster.desktop + CC0-1.0 + A 2D side scrolling space shooter + +

+ Curblaster is an ncurses based 2D side scrolling space shooter. + The objective is to transport pods safely through gates and obstacles. +

+
+ http://curblaster.sourceforge.net +
diff --git a/enemy_shoot.cpp b/enemy_shoot.cpp index afeb69a..1db529c 100644 --- a/enemy_shoot.cpp +++ b/enemy_shoot.cpp @@ -1,5 +1,5 @@ -#include "SDL/SDL.h" -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL.h" +#include "SDL2/SDL_mixer.h" #include "game_object.h" #include "play_sound_effect.h" diff --git a/main.cpp b/main.cpp index 08381bc..4dd2bf3 100644 --- a/main.cpp +++ b/main.cpp @@ -26,8 +26,8 @@ along with this program. If not, see . #include #include #include -#include "SDL/SDL.h" -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL.h" +#include "SDL2/SDL_mixer.h" #include "game_object.h" #include "check_collision.h" @@ -467,7 +467,6 @@ int main(int argc, char *argv[]){ //main loop int loopvar = 0; - int input = 0; int podcount = 0; int podsin = 0; int landercount = 0; @@ -582,11 +581,6 @@ int main(int argc, char *argv[]){ Mix_Music *title = NULL; - int audio_rate = 22050; - Uint16 audio_format = AUDIO_S16; - int audio_channels = 6; - int audio_buffers = 4096; - char *env_tty; env_tty = getenv("SSH_TTY"); @@ -594,6 +588,12 @@ int main(int argc, char *argv[]){ if(env_tty == NULL && sound == 1){ + int audio_rate = 22050; + Uint16 audio_format = AUDIO_S16; + int audio_channels = 6; + int audio_buffers = 4096; + + SDL_Init(SDL_INIT_AUDIO); if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) { @@ -670,6 +670,8 @@ int main(int argc, char *argv[]){ title = NULL; while(loopvar == 0){ + + int input = 0; clear(); // Draw board diff --git a/mishaps.cpp b/mishaps.cpp index 9de7bdd..efbb5db 100644 --- a/mishaps.cpp +++ b/mishaps.cpp @@ -1,8 +1,8 @@ #include #include #include -#include "SDL/SDL.h" -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL.h" +#include "SDL2/SDL_mixer.h" #include "game_object.h" #include "draw.h" diff --git a/motion.cpp b/motion.cpp index e33bcfc..7b78686 100644 --- a/motion.cpp +++ b/motion.cpp @@ -6,9 +6,10 @@ game_object change_elevation(game_object object){ - int adjust = 0; - if(rand()%100<=5){ + + int adjust = 0; + if(rand()%100<=50){ adjust++; } else { diff --git a/play_sound_effect.cpp b/play_sound_effect.cpp index 00c47ec..ebf85e9 100644 --- a/play_sound_effect.cpp +++ b/play_sound_effect.cpp @@ -1,5 +1,5 @@ -#include "SDL/SDL.h" -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL.h" +#include "SDL2/SDL_mixer.h" int play_sound_effect(Mix_Chunk *chunk, int channel){ channel = Mix_PlayChannel(-1, chunk, 0); diff --git a/powerup.cpp b/powerup.cpp index 399428c..77b4b4f 100644 --- a/powerup.cpp +++ b/powerup.cpp @@ -1,7 +1,7 @@ #include #include -#include "SDL/SDL.h" -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL.h" +#include "SDL2/SDL_mixer.h" #include "game_object.h" #include "play_sound_effect.h"