health- is this ode ok?

You must understand the Game Editor concepts, before post here.

health- is this ode ok?

Postby Wolly08 » Sun Jul 29, 2007 8:52 am

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
Wolly08
 
Posts: 39
Joined: Wed Jul 25, 2007 8:34 pm
Score: 2 Give a positive score

Postby pixelpoop » Sun Jul 29, 2007 9:30 am

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
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

THX

Postby Wolly08 » Sun Jul 29, 2007 12:39 pm

Thx mate you really helped me!!! :) :) :) :) i added a point 4 u :)
Wolly08
 
Posts: 39
Joined: Wed Jul 25, 2007 8:34 pm
Score: 2 Give a positive score

Postby Wolly08 » Sun Jul 29, 2007 12:57 pm

:( 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
:(
Wolly08
 
Posts: 39
Joined: Wed Jul 25, 2007 8:34 pm
Score: 2 Give a positive score

Postby pixelpoop » Sun Jul 29, 2007 9:43 pm

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby pixelpoop » Sun Jul 29, 2007 9:47 pm

here is a demo
Attachments
Life_countdown.zip
Click on the face 3 times to destroy itself
(196.81 KiB) Downloaded 180 times
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Re: health- is this ode ok?

Postby Sgt. Sparky » Mon Jul 30, 2007 2:48 am

Wolly08 wrote:hi im pretty rubbish at BASIC...

Game Editor basicaly uses C, not BASIC. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Mon Jul 30, 2007 3:36 pm

This is little out of topic, but has the GE code a name?
I've always called it ennobled C.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Thx

Postby Wolly08 » Mon Jul 30, 2007 5:56 pm

Thx :D :D :D you guys help me so much :D :D
Wolly08
 
Posts: 39
Joined: Wed Jul 25, 2007 8:34 pm
Score: 2 Give a positive score

Postby Game A Gogo » Tue Jul 31, 2007 2:51 am

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
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Sgt. Sparky » Tue Jul 31, 2007 3:24 am

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby DocRabbit » Tue Jul 31, 2007 7:29 am

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:
User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score

Postby Troodon » Tue Jul 31, 2007 5:18 pm

We could have
GEysir
It doesn't have the C tought...
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron