Page 2 of 4

Re: TTM revival?

PostPosted: Tue Jan 31, 2012 9:40 pm
by NightOfHorror
no...

Re: TTM revival?

PostPosted: Tue Jan 31, 2012 9:45 pm
by SuperSonic
Ok just wondering 'cus if so, I could just upload the source for each sfx I make. That way you could edit them. But I can also just upload the wavs :D

I'll do that today :wink:

Re: TTM revival?

PostPosted: Tue Jan 31, 2012 9:52 pm
by SuperSonic
Ok here, tell me what you think :D
http://www.mediafire.com/?o1h2cc388t89t

Re: TTM revival?

PostPosted: Tue Jan 31, 2012 11:06 pm
by NightOfHorror
The small one is a little to quick and quiet, but the rest are fine. I think I will actually make it like this. medium is enemy explosion, medium2 is player explosion, big is level2 explosion and mega is level3 enemy explosion. I am still wondering if I should add extras in which I would have the ultimate ship boss with the biggest explosion. There will be three levels and this is only part 1 of TTM and part1 of five in the series.

Re: TTM revival?

PostPosted: Tue Jan 31, 2012 11:29 pm
by SuperSonic
NightOfHorror wrote:The small one is a little to quick and quiet, but the rest are fine.

Ok, I'll fix that :D

Re: TTM revival?

PostPosted: Wed Feb 01, 2012 2:05 am
by SuperSonic
Hey Night, I got some good level code for you if you're interested :D

global code
Code: Select all
int level = 0;

view -> draw actor
Code: Select all
view.y = level * view.height;

With this code, all you have to do to switch levels is level++; and that's it :P

Re: TTM revival?

PostPosted: Wed Feb 01, 2012 3:28 am
by SuperSonic
Ok, here is an updated small explosion sfx :D
http://www.mediafire.com/download.php?zbnnw2wmtqnt3uz
How's that? :P

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 2:42 am
by NightOfHorror
I like it a lot, can you put them all in separate links now. Also, i have question. I wanted to maybe make TTM harder by having a missile_limit where you can shoot ten missiles at a time then you have to wait for your gun to cool down for 3-4 seconds before you shoot another ten. There are two problems actually. One is there is no way of me disabling one code at a time. Two is strange to me. I put down all the right codes to make 10 go down to 9 and then 8 if you press space, but it automatically goes to 1 then 0. I don't get it since the same codes are in another game and it goes 2 to 1 to 0. That is a game I am making too that required that code. I want to do this to add the dodging game to this. I may even make it where you have to wait a second between bullet to fire.

The code I used (MissileLimit is a text number, missile_limit is the variable that tells how much you have left to fire before overheated)

Code: Select all
KeyDown->Space->ScriptEditor->
missile_limit-=1;
missile_limit=missile_limit>0;
DrawActor->ScriptEditor->
MissileLimit.textNumber=missile_limit;

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 2:50 am
by skydereign
It makes perfect sense why it jumps to 1 if you understand boolean logic/comparative operators. You are setting missile_limit equal to a comparison.
Code: Select all
missile_limit-=1;
missile_limit=missile_limit>0; // this line right here sets it equal to missile_limit>0

missile_limit>0 resolves to either a 1 or a 0. It's like you how you use if(variable>0). The statement is true if the value is non-zero, while it is false if it is 0. So since missile_limit is greater than zero, that means missile_limit is being set to 1. Next time you run the code, it is reduced (now to zero) and the condition is now false, since missile_limit is actually not greater than zero. If you want to make it so it can't be less than 0, I suggest this code instead.
Code: Select all
missile_limit -= missile_limit>0;

For the same reason your code doesn't work, this will work. It reduces missile_limit by 1 if missile_limit is greater than zero.

Now about disabling a section of code. You are aware of variables, but it seems you don't know fully how to use them. You even know about if statements, so put two and two together. You want a bit of code to only work in some cases, or rather, if you are allowed to shoot missiles. So put the missile shooting code in an if statement, that way you only shoot when you are allowed to (not overheated).

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 3:00 am
by NightOfHorror
okay. Thanks for helping me sky. :D

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 3:08 am
by NightOfHorror
A new problem has occurred. If I put down missile_limit-=1; then missile_limit goes down by two at a time and then goes down one when at negatives. If I put down .5 it goes down by two and stops at 0.

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 3:37 am
by SuperSonic
Night, I have a better way to have your ships gun over-heat :P

Global code:
Code: Select all
#define OverHeatNumber 100
#define HeatRate 10
#define CoolRate 2
//The above state how hot your gun must be before over heating, how fast it heats up, and how fast it cools down respectively

int IsOverheated = 0;//If the gun is overheated
int Heat;//How hot your gun is

On Draw actor:
Code: Select all
Heat -= (Heat > 0) * CoolRate;//Cool your gun down a bit

if(!Heat)//If your gun has fully cooled off...
{
    IsOverheated = 0;//Then your gun is no longer over heated
}

else if(Heat > OverHeatNumber)//However, if the gun is hotter than it should be...
{
    Heat = OverHeatNumber;
    IsOverheated = 1;//Then it is overheated
}

On Key down(whatever key you use to fire)
Code: Select all
if(!IsOverHeated)//If your gun is not overheated...
{
    //Spawn your bullet here
    Heat += HeatRate;//Heat it up a bit
}

I hope that may help :D

Also...

NightOfHorror wrote:I like it a lot, can you put them all in separate links now.

May I ask why? :D

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 4:01 am
by NightOfHorror
thanks Sonic, you know, I wanted you to work more, jk. Well nvm about that statement. I cant give point now since I already gave one, but I will later.

Seeing your code actually gives me an idea how to do it my way, but your way seems more better for what I intended.

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 4:03 am
by NightOfHorror
Also, I do have a job for you, look at Help Wanted to see if you can do it.

Re: TTM revival?

PostPosted: Sun Feb 05, 2012 7:08 am
by skydereign
Just so you know, the reason it was going down by two is that the one line of code I provided reduces it by one (as I described it). If you look at the code and try to understand it, you'll learn a lot more. It seems you were thinking that the code I provided set the minimum (which is not the case). For the setting a minimum, you would have to use the max function.
Code: Select all
missile_limit = max(missile_limit, 0); // if missile_limit is less than zero, then max will return 0