aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-20 08:47:05 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-20 08:47:05 -0500
commitd6469d0cafc03c468c5977ec345d08b3ccb6fd0a (patch)
treec9b21ddcae956cc9d419d4d56997063eb95fc5f4 /main.cpp
parent1e6676c35ce4990981e8cda389ba39108437d66d (diff)
parentc1774c591f7897c1cfa28e05fdb7c72e07890933 (diff)
merge, particles
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 76ea66e..cb5a20a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -119,6 +119,7 @@ unsigned int deltaTime = 0;
GLuint fragShader;
GLuint shaderProgram;
+GLuint colorIndex;
Mix_Chunk *crickets;
@@ -329,6 +330,8 @@ int main(/*int argc, char *argv[]*/){
SDL_ShowCursor(SDL_DISABLE);
+ Texture::initColorIndex();
+ initEntity();
/*
* Initializes our shaders so that the game has shadows.
*/
@@ -942,13 +945,21 @@ void logic(){
switch(b->bsubtype){
case FOUNTAIN:
for(int r = 0; r < (rand()%25)+10;r++){
- currentWorld->addParticle(rand()%HLINE*3 + b->loc.x + b->width/2,b->loc.y + b->height, HLINE,HLINE, rand()%2 == 0?-(rand()%7)*.01:(rand()%7)*.01,((4+rand()%6)*.05), {0,0,1.0f}, 2500);
+ currentWorld->addParticle( rand()%HLINE*3 + b->loc.x + b->width/2,
+ b->loc.y + b->height,
+ HLINE*1.25,
+ HLINE*1.25,
+ rand()%2 == 0?-(rand()%7)*.01:(rand()%7)*.01,
+ ((4+rand()%6)*.05),
+ {0.0f,0.0f,255.0f},
+ 2500);
+
currentWorld->particles.back()->fountain = true;
}
break;
case FIRE_PIT:
for(int r = 0; r < (rand()%20)+10;r++){
- currentWorld->addParticle(rand()%(int)(b->width/2) + b->loc.x+b->width/4, b->loc.y+3*HLINE, HLINE, HLINE, rand()%2 == 0?-(rand()%3)*.01:(rand()%3)*.01,((4+rand()%6)*.005), {1.0f,0.0f,0.0f}, 400);
+ currentWorld->addParticle(rand()%(int)(b->width/2) + b->loc.x+b->width/4, b->loc.y+3*HLINE, HLINE, HLINE, rand()%2 == 0?-(rand()%3)*.01:(rand()%3)*.01,((4+rand()%6)*.005), {255,0,0}, 400);
currentWorld->particles.back()->gravity = false;
currentWorld->particles.back()->behind = true;
}