mhh...
Ich hab mir mal dein Szenario angeschaut...
Du kannst in deiner Klasse KillCounter eine Methode einfügen, die die Kills zurückgibt...
Ganz einfach mit:
public int getKills() { return totalCount; }
und dann musst du, um die Kills zu bekommen, da du den KillCounter in keiner Variable festgehalten hast, folgendes schreiben:
ui_.setScore(((KillCounter)getObjects(KillCounter.class).get(0)).getKills());
Dann hast du den Score auf die aktuellen kills gesetzt!
Aber noch was wäre wichtig:
Wenn du den Score nur dann neu setzen willst, wenn der alte übertroffen worde, schreibst du am besten:
int i_Kills=((KillCounter)getObjects(KillCounter.class).get(0)).getKills();
if(i_Kills>ui_.getScore())
{
ui_.setScore(i_Kills);
ui_.store(); // den Score zu speichern darfst du nicht vergessen! ;)
}
Und was du auch nicht vergessen darfst ist, dass UserInfo.getMyInfo(); auch 'null' zurückgeben kann.
Darum müsstest du das vorher abfragen. Das kannst du mit:
if(ui_==null)
return;
Dann wird die aktuelle Methode abgebrochen!
Du schreibst einfach in den Konstruktor deiner Welt-Klasse folgendes:
setPaintOrder(HighScore.class,Actor.class);
Am besten direkt in die Zeile nach dem 'super(1280, 800, 1);'
Dann werden alle HighScore-Objekte, die du der Welt hinzufügst, vor alle anderen Actor-Objekte gezeichnet und der Highscore liegt vor den Gegnern und Spielern! :)
Yes! :)
The collision detection checks for all pixel of the image, that overlaps and compares the two Colors. (depending on what I need it for, I say it has to ignore all colors, which transparency is taler than a predetermined value)
Well, that might be an idea, but I extra set down the transparency of the darkness, that you can see more...
It's not my aim to create a scary game. And I also think, that I won't have enough time this month, to think about a fast algorithm to create the shadows. (especially because of the round edges... And by the way im doing my A-levels this month (In Germany/Bavaria we still have school, even if it's my last month ;) )
I also took a look at Builderboys method to create the shadow, but he's using tricks, which I don't want to use, because they are only working, if the full game is tuned on this shadow overlay. And this tuning I don't like in any ways... :)
Thank you,
I'm programming for nearly exactly two years, now!
But till now I've got no experience with apps, sorry...
Maybe you can ask your question in the forum, I think there are some other people, which can help you! :)
Thank you!
If you need help, I can help you, of course!
But in nearly two weeks, the last exams for my graduation from high school start...
So unfortunately I don't have much time...
Currently I only program a little to relax from learning... :)
Thanks! :D
Well, I'm using UserInfo...
And there's also a score at the end, if your points get under 0...
Maybe there's a problem with your browser or a firewall is activated on your computer?
I don't know why it does not work for you... :-/
2013/6/13
Highscores
2013/6/13
Highscores
2013/6/10
Big Ocean
2013/6/7
In Shadow
2013/6/3
In Shadow
2013/5/27
Space
2013/5/25
Adventure
2013/5/24
Adventure
2013/5/23
Step Jumper