aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-12 22:55:41 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-12 22:55:41 +0800
commit9b5621bda033c2e6b7c622c7494c56a172543554 (patch)
treef5fd661441867ca8a100d5c8aedcce430864d9d4 /src/core
parent627d814f487ac38d4f9b9b71da9bef46f33b3dad (diff)
downloadbullet-lab-remix-9b5621bda033c2e6b7c622c7494c56a172543554.tar.xz
Initial implementation of smPath.
Minor changes on the (s)coll effect.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bullet.cpp12
-rw-r--r--src/core/bullet.hpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/bullet.cpp b/src/core/bullet.cpp
index ddbf964..15cfef0 100644
--- a/src/core/bullet.cpp
+++ b/src/core/bullet.cpp
@@ -23,13 +23,13 @@ void bulletBase::update()
if((pos-player->pos).l()>collrange)if(invincible)ccb=cb;
if((pos-player->pos).l()<=scollrange&&(pos-player->pos).l()>collrange)
{
- if(!invincible)scollrange=-1,++player->scoll,bmInstance->addFXBullet(grey);
- else{if(++cscb>scb)cscb=0,++player->scoll,bmInstance->addFXBullet(grey);}
+ if(!invincible)scollrange=-1,++player->scoll,bmInstance->addFXBullet(grey,5,5);
+ else{if(++cscb>scb)cscb=0,++player->scoll,bmInstance->addFXBullet(grey,5,5);}
}
if((pos-player->pos).l()<=collrange)
{
- if(!invincible)exist=false,++player->coll,bmInstance->addFXBullet(red);
- else{if(++ccb>cb)ccb=0,++player->coll,bmInstance->addFXBullet(red);}
+ if(!invincible)exist=false,++player->coll,bmInstance->addFXBullet(red,15,15);
+ else{if(++ccb>cb)ccb=0,++player->coll,bmInstance->addFXBullet(red,15,15);}
}
}
void bulletBase::render()
@@ -123,9 +123,9 @@ void bulletManager::renderBullet()
bullets[i]->render();
}
}
-void bulletManager::addFXBullet(TColors col)
+void bulletManager::addFXBullet(TColors col,int base,int var)
{
- int c=rand()%5+5;
+ int c=rand()%var+base;
for(int i=0;i<c;++i)
bullets[allocBullet<bulletFX>()]->init(0,col);
}
diff --git a/src/core/bullet.hpp b/src/core/bullet.hpp
index a917b95..244e944 100644
--- a/src/core/bullet.hpp
+++ b/src/core/bullet.hpp
@@ -80,7 +80,7 @@ public:
}
void updateBullet();
void renderBullet();
- void addFXBullet(TColors col);
+ void addFXBullet(TColors col,int base,int var);
bulletBase* getHandle(int id);
smEntity2D* getBulEntity2D(TColors col);
smEntity3D* getBulEntity3D(TColors col);