Recent posts by szymekk3 on Kongregate

Flag Post

Topic: General Gaming / My First game "Chalkboard Surfer"

Cheers man!

 
Flag Post

Topic: General Gaming / My First game "Chalkboard Surfer"

Hi
This is my first game, tell me what you think:
http://www.kongregate.com/games/szymekk3/chalkboard-surfer
All replies welcome!

 
Flag Post

Topic: Game Programming / [AS3] deleting layered objects SOLVED

Yes but I’m using the “for” loop :

for (var q:int = drawing.length-1; q>=0; q—)
{
var ln:Line = drawing[q];

 
Flag Post

Topic: Game Programming / [AS3] deleting layered objects SOLVED

I solved it, after some 2nd google search:

Creating lines:
addChildAt(nline, stage.numChildren-1);

I deleted them normally.

 
Flag Post

Topic: Game Programming / [AS3] deleting layered objects SOLVED

Hello
I made two variables to arrange all my sprites so that my game score is in front of everything( objects are added during game so creating them in order doesn’t work) :
public var layer1:Sprite = new Sprite();
public var layer2:Sprite = new Sprite();

Next I added them to my game:
addChild(layer1);
addChild(layer2);

Created one of the game objects:
layer1.addChild(nline);

Finally I tried to remove it:
layer1.removeChild(ln);

I get the following error:
ArgumentError: Error #2025: The supplied DisplayObject
must be a child of the caller.

I don’t know why this is happening as the code seems logical.
Any help appreciated!

 
Flag Post

Topic: Game Programming / [AS3]Checking Timer value SOLVED

maybe some day this will come helpful, thanks for the replies :)

 
Flag Post

Topic: Game Programming / [AS3]Checking Timer value SOLVED

You mean currentCount() ?

 
Flag Post

Topic: Game Programming / [AS3]Checking Timer value SOLVED

I just added two timers and I got the result i was looking for but just out of curiosity is it possible to check a timer’s value?

 
Flag Post

Topic: Game Programming / [AS3]Checking Timer value SOLVED

Hello
I added a power up in my game and when it is about to disappear(controlled by a timer) I want it to flash. I can get it to flash but I don’t know how to check the timer value, is it even possible? Or should I use two timers?
Here is my attempt
Code:
if (bonustimer<1000)
{
player2.play();
}

 
Flag Post

Topic: Game Programming / [AS3] assigning game score to a dynamic text_SOLVED_

Looks like I don’t need .toString() either.

 
Flag Post

Topic: Game Programming / [AS3] assigning game score to a dynamic text_SOLVED_

Good point! Thanks

 
Flag Post

Topic: Game Programming / [AS3] assigning game score to a dynamic text_SOLVED_

Haha thanks guys, Draco18s’s post had me searching on google and bumping into “TextField” I researched more and found a tutorial how to use it! Here is my solution:

Game Constructor:
Code:
public var myText:TextField = new TextField()

Main game loop:
Code:
myText.text ="Score: "+score.toString();
addChild(myText);

It works perfectly, Thanks for the quick replies!

 
Flag Post

Topic: Game Programming / [AS3] assigning game score to a dynamic text_SOLVED_

I don’t get what you mean, something like this?

xScore:TextField;

 
Flag Post

Topic: Game Programming / [AS3] assigning game score to a dynamic text_SOLVED_

Hello
In my game I want to add score, I have created a variable named score and succesfully added the score number in the main game loop. I traced it to see if it increases and it does.

Now I want to show the score to the user and I created a new movieclip named “xScore”, in it I made a dynamic text box and given it an instance name – “gameScore”. In my game class I declared the gameScore variable:

Code:

public var gameScore:xScore;

Then created the text box in the game constructor:
Code:

gameScore = new xScore();
gameScore.x=10;
gameScore.y=10;
addChild(gameScore);

Finally I tried to show the score varaible in my main game loop:
Attempt 1:
Code:

gameScore.text=score;

Attempt 2:
Code:

 gameScore.text=score.toString();

None worked and I don’t get any errors, the random number i typed in the dynamic text box doesn’t change, I also tried to leave it blank, which didn’t work either.
All help is appreciated!