Recent posts by Kim_Bo on Kongregate

Flag Post

Topic: Game Programming / <AS3> how to access stage [solved]

ok iv managed to do this in other way. I’v added class name to my “GameMovieClip” in libary, then added this dynamic to stage. After that i’v used “EventDispatcher” witch called function that removes “GameMovieClip” from stage… i am still noob at programing but its better way i think :)

thanks for help!! :)

 
Flag Post

Topic: Game Programming / <AS3> how to access stage [solved]

anyway its not working, can someone solve this??

 
Flag Post

Topic: Game Programming / <AS3> how to access stage [solved]

parent.Stage, does nothing. After CLICK game is getting back to beginning of mission.
Same thing with (this.Stage as MovieClip).gotoAndStop(1);

 
Flag Post

Topic: Game Programming / <AS3> how to access stage [solved]

yes but when i use stage.gotoAndStop(1); it gives me error:
Symbol ‘MGAME_MC’, Layer ‘actions’, Frame 1, Line 1537 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.

parent.stage isn’t working either. No mater if first letter is capital or not.. Anyone??

 
Flag Post

Topic: Game Programming / <AS3> how to access stage [solved]

Hi i have some problem :P i’v made a game with all AS3 code on one frame. Every game elements was putted in GAME_MC “by hand” (draging from libary). Now I wanna add some extra frames for game menus, sponsors, and stuff.
I’v added menu, in wich “start game” button, is function with gotoAndStop(frame with GAME_MC in it). How i can access any frame on Stage, from any MC inside GAME_MC (for example, game over screen have two buttons “start again” and “go back to menu”…

Most of mc’s have thier own instance name.

 
Flag Post

Topic: Game Programming / [AS3] Level design/parralax scrolling

Hi i am making game, and most of the graphic elements are ready now, but still having programing issues.

I dont know how to design pattern for level manager. Each of my levels is build in different way one have only 1 layer (floating background), one 3 layers (move able background, collision lines, and light effects- all 3 with same speed) and other level for example 6 ( static background, background, collision lines, parallax background 1, parallax background 2).
How to make a manager for this kind of levels. Where to put collision detection (in game class, player class or what)
Is there any ready to implement source code for that?? Would use Vcam, but i really don’t know how it works
Now i am just adding speed variable to player’s x position. When players.x > than something player speed = 0, and start adding same speed to background…

I am really new to OOP so i will be really appreciate for helping with those problems :)

 
Flag Post

Topic: Game Programming / [AS3] timer/star field

I am using some source files, and have some problems now.
I have star field, that moves with mouse (through starfield array, FOR loop update star positions). After clicking “play game button” i would like to move whole star field for few seconds into one direction (Y position).
So now my function is removing listener for mouse move, and start to move them.

So when i start to move with Enter Frame, all stars are getting off the stage.
When i use mouse function, all the stars are moving only once (one Y value).
When i use time function they don’t stop either. How to stop function after the stars move for example 200 px up, or after 3 seconds??


function timerListener(e:TimerEvent):void
{
	for (var q:int = 0; q < stars1.length; q++)
	{
		stars1[q].tx = (mouseX-ww/2)*stars1[q].moveratex + stars1[q].ix;
		stars1[q].ty = (mouseY-hh/2)*stars1[q].moveratey + stars1[q].iy;
		stars1[q].y -=  3 * stars_ease;
	}

}
 
Flag Post

Topic: Game Programming / <AS3> how to add proper ground collisions??

would like to achieve collisions like in “heli attack 3” or “Capsized”. That works with one from those two ground examples ( http://img834.imageshack.us/img834/2369/przykadc.jpg ). So when the player goes up the hill hes y position is getting smaller – the highest point on the hill, on actual players x position.

 
Flag Post

Topic: Game Programming / <AS3> how to add proper ground collisions??

.. i mean, i dont want my “hero” to stuck in the hill, hope you understand what i mean

 
Flag Post

Topic: Game Programming / <AS3> how to add proper ground collisions??

is there any other easy way to add collisions for such ground’s like on this pic:
http://img834.imageshack.us/img834/2369/przykadc.jpg
??

adding gravity, velocity and friction is preaty simple, but what should i use for detect point where “hero” should stop… and what with horizontal moves while the hill is befor him??

 
Flag Post

Topic: Game Programming / <AS3> how to add proper ground collisions??

Hi i’v question. How can i add some animation to objects added to “world” Movie Clip? I have some animation for different part of character (legs, head, arms ect). But i dont know how to add those animation labels to box2D.
Function “on key down hero_mc.legs.gotoAndStop(2)” dosnt work. Should i use only box2D syntax, or can i use normal AS3 to?? How can i use my own classes for each parts of game?

 
Flag Post

Topic: Game Programming / plot dialogs

i dont want to kill fun from playing game, but i would like to add some different missions accent’s (for example stealth missions with proper briefieng ect.) I will add skip button of course ;D

 
Flag Post

Topic: Game Programming / plot dialogs

Hi guys, i am looking for a source to make some “plot dialogs” loop. After each level i wanna have implemented text’s and avatars for dialogs, pressing space key would go to the next dialog line…

char1: that was preaty easy
char2: yea for sure
char2: but wait for next mission :P

anyone??

 
Flag Post

Topic: Game Programming / AS3 fill problem

No i dont want to change pixels. What i wanna do is make Action Scripted vector fill, that dosnt include elements on the Stage. So when those elements will be removed, there will only only this fill with transparent holes (in colour of stage backround).

 
Flag Post

Topic: Game Programming / AS3 fill problem

… imageshack.us/photo/my-images/21/wypenienie.jpg/

 
Flag Post

Topic: Game Programming / AS3 fill problem

Hi i would like to fill some MovieClip with colour, but i wanna make it so there will be cutet some object/png files ect.

]
Blue on left are the objects on stage, and green on right is the fill of new movie clip.
hope you understund what i mean..

 
Flag Post

Topic: Game Programming / simple gravity

yes, some prediction line. I am implementing something like in Fragger game. With min and max force of throwing…

 
Flag Post

Topic: Game Programming / simple gravity

Looking for simple gravity examples. I know how to made some ball bouncing around stage with friction, but what if ground isnt horizontal?? I am looking a way to add some gravity to hand granades, and it would be good to have it bounce of the all object on stage (walls, enemies, ground ect).
How to draw bezier curve/vector of granade throw (with rotation) before start of the animation?

Anyone??

 
Flag Post

Topic: Game Programming / [AS3] lots of questions ;)

i dont think so.. you could watch for example “armed with wings” game. He has great animation, and tho jumping system isnt god it can be made better. I would rather make something like in The Atonement game.. so any sugestions??

 
Flag Post

Topic: Game Programming / [AS3] lots of questions ;)

now i wondering about programing some inertia forces. Idea is that when i release run button player dosnt stop imidetly. He slows down to walking frames, and then he stops. And in jumping frames, when player lands legs go to animation where knees are bending, torso is coming down for a moment and back to normal position..

And there is problem with rotating arms. There are double handed weapons, and i am wondering how can i manage rotation of the hand that is behind players torso. The easiest way would be rotate whole upper torso, but i need something more complex. Sugestions??

 
Flag Post

Topic: Game Programming / [AS3] lots of questions ;)

Hi i am new here and just started to learning AS3. I am mostly learning from source files, cuz this is best way for me, so it would be nice if you also take this into consideration.

So i have few questons…

i am doing some game for my graduation, and first of all i would like to know whats best AS3 file structure. Should i make different as files for different classes, or just one file with whole code.

Since this is side scrolling shooter, how would you implement guns inventory? I mean i would like to have shooting function under mouse button, but bullets for each weapons would have different properties (reflection, explosion ect). What would be the best system for do this(arrays) Is there any good tutorial for something similar in the net you would recomend??

And what abou AI’s for every enemy?? Im thinking about “finite state machine” (states from patroling, attacking, covering ect). How to write AI class in the way that i could choose first state and parameters (weapons, anle of view, facing) for every enemy that is spawned on each lvl??

If you could recommend some good tutorial or something i would be appreciated.