score

Talk about making games.

score

Postby hobgoblin » Sun May 02, 2004 5:27 pm

how do i make the score???
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby ingsan » Sun May 02, 2004 6:42 pm

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:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby hobgoblin » Sun May 02, 2004 8:16 pm

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: )
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby Just4Fun » Mon May 03, 2004 2:25 am

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.
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Mon May 03, 2004 7:47 am

this is a file that holds bitmap drawn numbers in ascii sequence
For Numbers, you'll have a bitmap with numbers 0123456789.
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby hobgoblin » Wed May 05, 2004 12:11 am

i tryed the moon defender and guess what... :?



Image

i need this one

or one picture for each number?
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby Just4Fun » Wed May 05, 2004 3:17 am

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:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby ingsan » Wed May 05, 2004 7:49 am

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:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby hobgoblin » Sat May 08, 2004 7:21 pm

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:
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby Just4Fun » Sat May 08, 2004 8:36 pm

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"
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby hobgoblin » Sun May 09, 2004 2:48 am

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?
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby ingsan » Sun May 09, 2004 11:30 am

:? 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;
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Sun May 09, 2004 2:03 pm

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


Use this:

if(MyTextActor.textNumber == 50)
{
//some thing
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby hobgoblin » Tue May 11, 2004 9:39 pm

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)
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby hobgoblin » Tue May 11, 2004 10:04 pm

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
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron