Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to die?

Author
Message
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 12th Apr 2010 15:22
i'm having a problem with dying, iv tried switch code but it doesn't work, basicly iv tried making health in this case i called it player made it equal 100 and every time you get hit it goes down when it was smaller then 0 ( player <= 0) i would switch it to the dying code but this doesnt seem to work, any other ideas about how i can die thx

www.robsterone.webs.com

my website
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 12th Apr 2010 15:30
how to die?

we cant help since you are not showing any code, we can't figure what your code looks like

Nizze
16
Years of Service
User Offline
Joined: 12th Jan 2008
Location: Right here - where else?
Posted: 12th Apr 2010 16:43
The thread's name could be better

I guess you could just use a simple if-statement;



(and you'd have to replace the KillPlayer() function with whatever you do to kill the player)

long Array[2147483657][2147483657][2147483657][2147483657];
What could possibly go wrong??
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 13th Apr 2010 00:32
well with the functions kill player you would have to start it doing something that can make is seam your dying such as the camera rolls back and falls to the ground and looks up towards the sky and the work printed on the screen or image saying "You Got Killed" or "Game Over" and when the dying finishes have a countdown to a screen with options on what to do next.

Plan out:

Player Gets Killed-> Dying Animation -> Dying Animation Finish -> Count Down -> Options on what to do next.

Hope that helps

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 13th Apr 2010 12:43
thx for the help but i understand (i think) what I need todo but heres an example of what my code looks like:



so basicly my problem is that it wont switch around. thx for the help
and i know the name of the thread could have been better but its drawn attention

www.robsterone.webs.com

my website
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 13th Apr 2010 16:06
maybe "if ( playerHP <= 0 ) level1 = 1;" ?

robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 13th Apr 2010 21:16
@Hassan

ye I have but it wont work iv also tried puting that line of code in alot of other places iv tried alot of different things but it wont switch im sure if its something todo with the loop but other than that iv got no idea oh and as a side question when I put "return;" in it to exit it just restarts the Intro no idea how tht works so how would I exit the program if return does work ? thx for the hellp

www.robsterone.webs.com

my website
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 13th Apr 2010 21:30
we can't imagine your code as i said above, you probably added return in the wrong place, you can show us some code so we can help you

JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Apr 2010 21:38
I don't see no loops just an incomplete switch statement.



Hope this helps.


JTK
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 13th Apr 2010 22:17
sorry i should mention that i dont no alot about c++ and so what is Default or is that just your choosen name and whts ASSERT

oh and tht basicly is my ode showing the rest would be pointless cos its just code for my main menu and the level and the switch code is in a loop srry for not saying

www.robsterone.webs.com

my website
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Apr 2010 23:34
ASSERT is a macro that helps u trap unexpected errors. You will assert that the expression is true. If its not true it will show an error.

default is a keyword (as is break) and is a part of a switch statement.

All three are well documented in the help files so look them up for a better understanding.

Regards

JTK

Ps disregard the fact that they were proper cased. My phone proper cases evey new line and I didn't want to keep backspacing to fix them.
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Apr 2010 23:39
Oh one more thing

Being new to c++ it probably would be a good idea to show your code as the error you think you're seeing could be caused somewhere else and won't be able to see that without the related code...

That's all...

JTK
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 14th Apr 2010 14:54
by the way it seems you should do the following in the Intro() function:

and then the switch statement should be executed once more.
your code's structures looks wrong, and messy

robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 14th Apr 2010 23:05
thx for all ur help i think iv got it sorted now

www.robsterone.webs.com

my website
haliop
User Banned
Posted: 16th Apr 2010 14:08
with all that said
i guess the easiest way
is to take hugh amount of drugs..

it should kill any ai what so ever just


int ai_drugMax = 10; // max drugs ai can take
if (ai == not good enough)
{
GiveDrugstoAi(11); // one more will do the job
}

// now we need to check if the ai still exist so there will be no errors later on
while (ai[num] == alive && GetAiDrugs[num]> ai_drugMax)
{
InviteAllAiFamily(num);
SelectAiGrave(num,big);
SelectAiGraveTexture(num,stone);
InviteAiReligousPriest(num);
SelectScene(graveyard);
}
// ok after getting all of the Ais which been druged
// now switch to the graveyard scene
SwitchtoScene(graveyard);
for (i = 1;i < aiMaxNumber; i++)
{
if (ai[num].GetScene())
if (ai[num].AllFamily == at Scene(graveyard))
StartSequence(Burry);
// and ofcourse we need to kill the ai
ai[num].Dead;

}

// thats it.
i think this will be much helpfull to anyone who like simple comedy.
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 17th Apr 2010 23:49
thx haliop thts solved me problem now i no exactly how 2 die!!!

www.robsterone.webs.com

my website
haliop
User Banned
Posted: 18th Apr 2010 11:24
i glad i could help
can i offer a funeral service? they make awesome pie

Login to post a reply

Server time is: 2024-07-07 01:56:09
Your offset time is: 2024-07-07 01:56:09