Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
You can opt for an individual object for every possible score value, or you could use a custom font and have it as text that floats instead.
Create an object called "obj_score" or something similar.
Now in the code where your enemy object is destroyed:
score_number = instance_create(x, y, obj_score);
is very important. This saves the id of the instance you just created to a variable which you can later use to modify that instance specificly. You should be sure to use the variable holding the INSTANCE id within the with statement and I believe it should work, unless I misdiagnosed the problem entirely.
obj_enemy Destroy event:
if (sprite_index == spr_enemy_1535)
{
score_number = instance_create(x,y,obj_added_score)
with(score_number)
{
mypoints = 1535;
}
}
And did that for every type of sprite enemy
Then my obj_added_score Draw event is just:
draw_text(x,y,"+"+string(mypoints));
Also, you don't need to hard code the number into "mypoints." You could use a variable or calculation. That way you could have a score multiplier tied to an alarm or something similar. Of course, we're only looking at a very small part of your code, so I'm not sure what will work for your specific project.
Yeah, I have 20 different enemies all with different point values, so it worked best to hard code them in (: