Page 1 of 1

Restore life

PostPosted: Thu Nov 01, 2007 3:56 pm
by Azou
HHHIIIIII!!!! :D I post this topic to ask how to makea "restor life"? Likeif sangoku takes a hamburger,he'll recover 25 percents of his lif :lol: :D e?

Re: Restore life

PostPosted: Thu Nov 01, 2007 4:55 pm
by Kalladdolf
you have the variable "life".
sangoku -> collision -> any side of hamburger -> script editor ->
Code: Select all
life = life + 25;


:D

Re: Restore life

PostPosted: Thu Nov 01, 2007 5:05 pm
by Azou
:D :D Work::thanks

Re: Restore life

PostPosted: Sat Nov 03, 2007 10:27 pm
by Troodon
You asked how to increase health with 25% didn't you?
Health += 25 just adds 25 to your health. If you want to have it 25% bigger, you can use:
health = health * 1.25;
:D

Re: Restore life

PostPosted: Sun Nov 04, 2007 3:29 pm
by Azou
Thanks very much!! It's work :mrgreen:

Re: Restore life

PostPosted: Sun Nov 04, 2007 4:54 pm
by Troodon
No problem. If you have any other questions about variables, just ask. :D

Re: Restore life

PostPosted: Sun Nov 04, 2007 5:14 pm
by Azou
Ho,Tekdino,i know that you were preparing your games,because you stay long time without connected in the forum,weren't you?? :wink:

Re: Restore life

PostPosted: Sun Nov 04, 2007 5:21 pm
by Troodon
I wish I could work on my games. But no, I don't have very much time for my games because I'm so busy with other things. :wink:

Re: Restore life

PostPosted: Wed Nov 07, 2007 5:39 pm
by Kalladdolf
talkin' about busy, we are writing a latin test tomorrow, an english exam the day after,
on monday a history exam and after that and a latin vocabulary test after that :o :roll:
I have to practise 40 minutes piano a day, the way to my school takes 1 and a half hours,
etc...

SO U GUYS NOW THINK OF HOW I MANAGE TO BE ONLINE ONCE A DAY :!:

Re: Restore life

PostPosted: Thu Nov 08, 2007 10:03 am
by Bee-Ant
use this to make your health increased smoothy : (It's looks more beautiful, i'm sure :D )

Player>CollisionEvent>Hamburger>CreateTimer>StopIncrease>2000 ms, periodic, 1 time

Player>CollisionEvent>Hamburger>CreateTimer>Increase>50 ms, periodic, unlimited

Player>Timer>Increase>ScriptEditor>
Code: Select all
health++;

Player>Timer>StopIncrease>ScriptEditor>
Code: Select all
DestroyTimer("Increase");

Hamburger>Collision>PLayer>DestroyActor>EventActor


Just set your "StopIncrease" timer until you get 25% of increased live... :D
maybe 1000 ms, 1500 ms, etc... :D
Hope help

Re: Restore life

PostPosted: Sat Nov 24, 2007 12:35 pm
by Azou
Well it works!But can you tell me how to make that,when the character is punching somebody,the energy is restored?? :D

Re: Restore life

PostPosted: Sat Nov 24, 2007 1:54 pm
by j2graves
r u using my "touching" variable?

Re: Restore life

PostPosted: Tue Nov 27, 2007 6:04 am
by Bee-Ant
Ah..it's too easy... :D :D

Player>CollisionEvent>Enemy>ScriptEditor>
Code: Select all
if(attack==1)
{
    health++;
}


Player>KeyDown>"WhateverKey">ScriptEditor>
Code: Select all
if(right==1)
{
    ChangeAnimation("EventActor","PunchRight",FORWARD);
    attack=1;
}
if(right==0)
{
    ChangeAnimation("EventActor","PuchLeft",FORWARD);
    attack=1;
}


AnimationFinish>PuchRight>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor","StopRight",FORWARD);
attack=0;


AnimationFinish>PuchLeft>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor","StopLeft",FORWARD);
attack=0;



Sooooooooooooooo.............simple right? :D :D