Page 1 of 1

health- is this ode ok?

PostPosted: Sun Jul 29, 2007 8:52 am
by Wolly08
hi im pretty rubbish at BASIC but i have come up with a code that may work for a health bar and i was hoping someone with more knowlage than me could make it so GE knows what im saying.
my idea was you have --- te tell you how many lives you have so you make an actor and make its text :3.
and make a code a little bit like this
Code: Select all
Live_count.textNumber = Live_count.textNumber - 1;
if(Live_count).textNumber= 0 destroy actor Player

PostPosted: Sun Jul 29, 2007 9:30 am
by pixelpoop
Use the code like this:

In a create actor script for your actor Live_count put:
textNumber =3;


Put this on your player's collision script with a bullet or whatever:

Live_count.textNumber -=1;
if (Live_count.textNumber == 0){ DestroyActor("Event Actor");}



Note:
-the way you did the first line is fine, this way is just cleaner.
-one equals sign is used to assign a value
-two equals signs checks a value

THX

PostPosted: Sun Jul 29, 2007 12:39 pm
by Wolly08
Thx mate you really helped me!!! :) :) :) :) i added a point 4 u :)

PostPosted: Sun Jul 29, 2007 12:57 pm
by Wolly08
:( hold on i wroth that post before i tried it out (looked at the code and it looked fine) but when you try it out its not deleting itself
:(

PostPosted: Sun Jul 29, 2007 9:43 pm
by pixelpoop
did you make the life count actor a text actor?
Click on your actor, click on Text, add a New Font, add a 0 to the text field, click ok.

PostPosted: Sun Jul 29, 2007 9:47 pm
by pixelpoop
here is a demo

Re: health- is this ode ok?

PostPosted: Mon Jul 30, 2007 2:48 am
by Sgt. Sparky
Wolly08 wrote:hi im pretty rubbish at BASIC...

Game Editor basicaly uses C, not BASIC. :D

PostPosted: Mon Jul 30, 2007 3:36 pm
by Troodon
This is little out of topic, but has the GE code a name?
I've always called it ennobled C.

Thx

PostPosted: Mon Jul 30, 2007 5:56 pm
by Wolly08
Thx :D :D :D you guys help me so much :D :D

PostPosted: Tue Jul 31, 2007 2:51 am
by Game A Gogo
tekdino wrote:This is little out of topic, but has the GE code a name?
I've always called it ennobled C.

It is usually called C, but maybe we can call it Cge :D

PostPosted: Tue Jul 31, 2007 3:24 am
by Sgt. Sparky
Game A Gogo wrote:
tekdino wrote:This is little out of topic, but has the GE code a name?
I've always called it ennobled C.

It is usually called C, but maybe we can call it Cge :D

GEC
Game Editor C :D

PostPosted: Tue Jul 31, 2007 7:29 am
by DocRabbit
or maybe even GECscript®...... :) Suns got their Java, MSs got their VB, but we've got the GEC... Too bad Geico has the Gecko already, could be our mascot.... :lol:

PostPosted: Tue Jul 31, 2007 5:18 pm
by Troodon
We could have
GEysir
It doesn't have the C tought...