Page 1 of 2

score

PostPosted: Sun May 02, 2004 5:27 pm
by hobgoblin
how do i make the score???

PostPosted: Sun May 02, 2004 6:42 pm
by ingsan
Create an Actor. Call it score.
In Actor Control, put an ASCII text containing numbers 0-9.
Then on CreateActor > Script :
    count = 0;
To test :
On MouseDown (Left) > Script :
    count = count + 1;
    score.textNumber = count;

On MouseDown (right) > Script :
    count = count - 1;
    score.textNumber = count;

See also :
http://game-editor.com/forum/viewtopic.php?t=32&highlight=score :wink:

PostPosted: Sun May 02, 2004 8:16 pm
by hobgoblin
put an ASCII text containing numbers 0-9.


what is that!?

(i never used text before...and i think i never saw that key there :shock: )

PostPosted: Mon May 03, 2004 2:25 am
by Just4Fun
Hi hob..,
Look at the Moon Defender tutorial. There is a section there that shows you how to use an ascii text file. Basically, this is a file that holds bitmap drawn numbers in ascii sequence. You need to tie this bitmap file to the actor using the actor's text button.

PostPosted: Mon May 03, 2004 7:47 am
by ingsan
this is a file that holds bitmap drawn numbers in ascii sequence
For Numbers, you'll have a bitmap with numbers 0123456789.

PostPosted: Wed May 05, 2004 12:11 am
by hobgoblin
i tryed the moon defender and guess what... :?



Image

i need this one

or one picture for each number?

PostPosted: Wed May 05, 2004 3:17 am
by Just4Fun
Hob,
Now that you have your "number.png or bmp" file, you need to add the text from your file to your actor.
In the Actor Control select the text button and input the following:

Text: 00 //can enter any number of 00000s or other numerals from your file-0123456789
File: numbers.png //or the name of your numbers file
Initial font char: 0 //first character in your file
Number of font chars: 10 //total number of characters in your file 0-9=10

Now your text is connected to your "ActorCounter". In order to add to (increment ) your number do the following script on another actor:

OnMouseDown Event-->Action--> script:

MyActorCounter.textNumber=MyActor.textNumber+1;//each time you click the mouse on your other actor, your counter number will increase.

HTHs.... :wink:

PostPosted: Wed May 05, 2004 7:49 am
by ingsan
i need this one or one picture for each number?

Hob, you can use this one IF you want to have your score look like it.
If you want PERSONAL score design, you can make your own one. But remember that when you design an ASCII, there should be the SAME amount of space between each number :wink:

PostPosted: Sat May 08, 2004 7:21 pm
by hobgoblin
i did just's and it works
but when i push the key, it goes from 00 to 01
nothing happens it i push again :shock:

PostPosted: Sat May 08, 2004 8:36 pm
by Just4Fun
All you need to do is:

Create 2 actors (One text actor-"MyTextActor" and one other actor-"MyOtherActor") If you wish, you can also just use this script on only one text actor.

Now:
1. MyOtherActor --> Event: KeyDown
2. Action: CreateActor --> Script
3. Enter this script: MyTextActor.textNumber=MyTextActor.textNumber+1;

Run the program. Each time you hit the key that you selected in the keyDown Event. The textNumber will be incremented. HTHs... :)

******************************************
if you want to use ingsan's code use this script:

// Increments "MyTextActor" by 1 for each keyDown Event

int count=0; //create variable "count" to hold your number

if count>=0;//test variable "count" value if greater than or = to 0 keep doing the increments

MyTextActor.textNumber=MyTextActor.textNumber+1;//change the screen text string to match the number in the variable "count"

PostPosted: Sun May 09, 2004 2:48 am
by hobgoblin
ok...i was thinking...
i when my score is 50, i want to "something happen"

in MyOtherActor - script

MyTextActor.textNumber=MyTextActor.textNumber+1; //like you said

int ooo;
ooo = MyTextActor.textNumber;
if(ooo = 50) "spit in the floor";

but when i do that, it says "unexpected declaration"
what am i doing wrong?

PostPosted: Sun May 09, 2004 11:30 am
by ingsan
:? I don't know what is wrong with your code but try to do this :

int count = 0;

onKeyDown (Any Key) :

count = count + 1;
myTextActor.textNumber = count;

For conditional Action :

if (count == 50) Action;

PostPosted: Sun May 09, 2004 2:03 pm
by makslane
hobgoblin wrote:int ooo;
ooo = MyTextActor.textNumber;
if(ooo = 50) "spit in the floor";


Use this:

if(MyTextActor.textNumber == 50)
{
//some thing
}

PostPosted: Tue May 11, 2004 9:39 pm
by hobgoblin
makslane wrote:
hobgoblin wrote:int ooo;
ooo = MyTextActor.textNumber;
if(ooo = 50) "spit in the floor";


Use this:

if(MyTextActor.textNumber == 50)
{
//some thing
}


ty 8)

PostPosted: Tue May 11, 2004 10:04 pm
by hobgoblin
one more one more!

can we start the score with a number?

i started with 100, but when i make points it goes to 001 again :x