Here is a breakdown of constants.h
Code: Select all
#ifndef CONSTANTS_H
#define CONSTANTS_H
Just a bunch of geek stuff. don't mess with it and you'll be fine
Code: Select all
const int POWERUP_PERIOD = 5 * 60;
POWERUP_PERIOD is in seconds, but most people would like to have the delay between powerups in minutes. 5 times (the *) 60 seconds = a whole lot of seconds. change the five to whatever you want.
Code: Select all
const int POWERUP_PERIOD_VARIANCE = 30;
the same units and everything. in the example it is 30 seconds (you could replace it with 4 * 60 or whatever). think of this as sort of an error margin. this is how randomly you want powerups to happen. so,
if you set POWERUP_PERIOD to say, 10 (ten seconds may be too short for you, just an example.) and POWERUP_PERIOD_VARIANCE to 5 then:
powerups will happen every ten seconds give or take 5 seconds. anywhere from 5 seconds to 15 seconds, but averaging every ten.
Code: Select all
const int POWERUP_DURATION = 15;
const int POWERUP_DURATION_VARIANCE = 10;
Here we get to your problem.
This says you will get a powerup that lasts 15 seconds give or take 10.
a more practicle values would be say, one minute (60) give or take however many seconds.
more geek stuff. play with it and you will be badly scarred for the rest of your life.
everything after the // (on the same line) is ignored.
leave the semicolon where it is. put all your values before it.
here is a more modified constants.h for an example.
Code: Select all
/*****************************************************************************
constants.h
This section should be heavily commented, if you need help, feel free to PM me
if you need to change the types and amounts for the different powerups, you
may need to
a)
learn C++
b)
PM the heck out of me so I either change it or get around to implementing
it through config files
Have fun! ;)
*******************************************************************************/
#ifndef CONSTANTS_H
#define CONSTANTS_H
const int POWERUP_PERIOD = 2 * 60 * 60; // two hours
const int POWERUP_PERIOD_VARIANCE = 60 * 60; // one hour
const int POWERUP_DURATION = 5 * 60; // five minutes
const int POWERUP_DURATION_VARIANCE = 60; // give or take one minute
#endif
you will be pleased to know that i will
eventually write a config file framework (and it has been bumped up in priority) the bad news it that i'm a lazy bum with more important things to work on (like different triggers for powerups).
About the colors: you can currently have more than one powerup on at the the same time. you can see this by setting POWERUP_DURATION to less then POWERUP_PERIOD. you will get a green powerup, and then after a while, you may get a yellow powerup (or is it orange), and so on.
Why? because if you have mass slaughter (ie geno + base camping) as a trigger (my next project) AND there is a timed powerup that happens at the same time, you get twice the fun (and it lasts longer too).
Anyhow, thanks for your interest, and I will always be here to help people out.
Mainly of course so they don't blow my planet up.
