Recent posts by aenil333 on Kongregate

Flag Post

Topic: Game Programming / [AS 3]Some Advice about Accessing objects in an Array

you have an error if you are trying to access with this die0.gotoAndStop(1+Math.floor(Math.random()*6);
since your array is dice not die… ;p

 
Flag Post

Topic: Game Programming / 2D Manager Engine

well there are two game made by the same person “littlegiantworld” so he probably use the same engine. But almost every tycoon game looks like the same. They probably use that idea as a general idea for making their games. Thats why the similitude between them and the kind of (not always) pixel art that come with it.

http://www.ehow.com/way_5296186_list-tycoon-games.html

 
Flag Post

Topic: Game Programming / getting image from a x y coordinate

yup getObjectUnderPoint was the solution… took some hours but FINALY lol

there is probably better solution but anyway, here is how im using maybe could give idea to others, its pretty simple actually:

for (var x = 0; x < stage.getObjectsUnderPoint(enemyNextMovePoint).length; x++) {
if (stage.getObjectsUnderPoint(enemyNextMovePoint)[x].name == “Ground”) { //do stuff here }
}

 
Flag Post

Topic: Game Programming / getting image from a x y coordinate

i think i might find a solution with this function but not totally sure how to use it yet

getObjectsUnderPoint(point:Point):Array
Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance.

 
Flag Post

Topic: Game Programming / getting image from a x y coordinate

i name all my object with object.name. What i do is build a map in 3 part and name each tile with border, ground, object. When my character move on i check if the object clicked is a ground and then move the character to that position. I want to do the same with my npc so i need to check if the x and y coordinate of the next move is a ground and walkable.

 
Flag Post

Topic: Game Programming / getting image from a x y coordinate

Hey guys im making a npc walk into a tilebased map and im choosing randomly coordinate like this:

x = randomize(mindistance,maxdistance);
y = randomize(mindistance,maxdistance);

with mouse event handler i can just do e.target.x and i can get the tile coordinate then align my character to move in middle of it no prob, i just want to reproduce this with my npcs. I dont know how to find the object any ideas?

 
Flag Post

Topic: Game Programming / Have problem coding?

http://www.youtube.com/watch?v=1S1fISh-pag

 
Flag Post

Topic: Game Programming / as3: quick answer

you dont see the trace made a hero ?

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

i dont think the i—; is necessary too since the loop is in a enter frame it will check again and again anyway… thats could be an issue when there is more object to check tought… Thats why i was wondering first if it was a good idea to place that loop in a enter frame. But i dont see where else i could place this since i need to check the hittest each time the character move

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

The array GoldCoinArray contain another array with the bitmap of the coin and the value of that coin only. Using GoldCoinArray.splice(i,1) i remove the entire line of that array since i dont need it anymore right ? I added 10 coin on the map randomly and walked over it thats what is the result of the array after each coin collected, the line was removed perfectly:

Gold collected!
[object Bitmap],2,[object Bitmap],1,[object Bitmap],2,[object Bitmap],2,[object Bitmap],3,[object Bitmap],1,[object Bitmap],3,[object Bitmap],3,[object Bitmap],1
Gold collected!
[object Bitmap],1,[object Bitmap],2,[object Bitmap],2,[object Bitmap],3,[object Bitmap],1,[object Bitmap],3,[object Bitmap],3,[object Bitmap],1
Gold collected!
[object Bitmap],1,[object Bitmap],2,[object Bitmap],2,[object Bitmap],1,[object Bitmap],3,[object Bitmap],3,[object Bitmap],1
Gold collected!
[object Bitmap],1,[object Bitmap],2,[object Bitmap],2,[object Bitmap],1,[object Bitmap],3,[object Bitmap],1

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

now working fine only changing the 0 to 1… gnah

for (var i = 0; i < GoldCoinArray.length; i++) {
				if (Player.hitTestObject(GoldCoinArray[i][0])) {
					var goldtext:TextStuff = new TextStuff(Player.x, Player.y -(Player.height + 20),GoldCoinArray[i][1],0xFFFF00, 14, false, true,2,1);
					addChild(goldtext);
   					removeChild(GoldCoinArray[i][0]);
					GoldCoinArray.splice(i,1);
					trace("Gold collected!");
				}
			}
 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

and yeah i was doing splice(i,0)… thinking it would target the first cell of my array line, got confused there thats why it was firing many time i guess

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

Why is that a hack ? I’m not totally sure why that command work actually, i checked google and saw people saying to do this on stackoverflow. I never use the parent function but im guessing it just check if its currently active or not in the parent displayobjectcontainer which should be the stage ?

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

Solved by myself… Had to speak about it to solve it lol… After a couple hour staring at screen here was the solution:

if (Player.hitTestObject(GoldCoinArray[i][0]) && GoldCoinArray[i][0].parent) {

just added that && GoldCoinArray[i]0.parent and everything goes fine

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

Maybe i do something wrong in my for loop fonction here it is:

for (var i = 0; i < GoldCoinArray.length; i++) {
				if (Player.hitTestObject(GoldCoinArray[i][0])) {
    					removeChild(GoldCoinArray[i][0]);
					GoldCoinArray.splice(i,0);
					var goldtext:TextStuff = new TextStuff(Player.x, Player.y -(Player.height + 20),GoldCoinArray[i][1],0xFFFF00, 14, false, true,1,1);
					addChild(goldtext);
				}
			}

If i remove the enter frame and character has to walk further on the map while collecting gold everything will stop.

 
Flag Post

Topic: Game Programming / removeChild on enter_frame event

Hi guys, kinda stuck with a problem. I have gold coin on my maps laying around on the ground, those gold coin are added from the level creation function. I got a enter_frame event which is used to make the character move around by clicking on the ground. In that enter frame i have added a for loop that check trough a itemarray if there is a collision with player and any item in the array so when the character pass by the item it is then removed and collected. Thing is, enter frame fire many time a second and just go too fast so my object is removed but tries to remove it again and again resulting in a couple error saying the displayobject isnt there (after it got removed once). I dont see how i can remove the items other way than having it in that enter frame loop. Any suggestion?

 
Flag Post

Topic: Collaborations / Experienced Flash/Actionscript programmer needed

do you have graphic or anything made yet ?

 
Flag Post

Topic: Game Programming / [AS3] Slowing Down Event Listener

are you trying to do this on the enter_frame ?

 
Flag Post

Topic: Game Programming / Looking for honest voters to rate my game

Just adding a simple texture as background with a mono color could change it all…

 
Flag Post

Topic: Game Programming / Looking for honest voters to rate my game

The concept is very nice and original. The graphic need alot of work. The way you position things on screen like bonus and all is weird. But the game play is genius, i give it a 3 star.

 
Flag Post

Topic: Game Programming / Looking for a SIMPLE Flash Program.. Ideas?

Well i know as3 and how to code generally ive been coding in many language, the thing im bad at is math. With stencyl, alot of this is already taken care of… that kinda quicken everything for me. But after only 1 day of using it i can say its somewhat limited. The behavior and event set there are general, if you want some specific effect or whatever you have to code it. Like i wanted an actor to simulate a fog like continuous scrolling horizontally (can only do it with backgrounds on stencyl) so i have to code it. But this is less hard for me since i know the logic behind and there is no real math. I love as3 cause i can do website and all or even apps with it but for a game engine, no way i can create something as close as stencyl does. Would take me way too much time. And yes performance seem a little problem already… I can walk around easily but when i move mouse at same time, everything start lagging and almost freezing for a couple sec. But i dunnoh ill try to go as far as i can with it see how big the performance problem can be. There must be some solution i saw some tutorial for reducing the code for performance didnt get into it yet but ill check it later.

edit: fixed my lagging issue with mouse and control… was my fog code lol

 
Flag Post

Topic: Game Programming / Looking for a SIMPLE Flash Program.. Ideas?

Well i created a little demo of what i could do in a few hour (3-4) with stencyl. Its not laggy but i can see in the codes that there is alot of useless stuff like they add ios touchscreen button and all the kit that might be why some game created with this are laggy. Its just a question to remove it and have your project cleaned i guess which most of people using this might not known. You can also directly code in as3 instead of using behavior blocks from the stencyl engine. And sometime even the behavior is quite complicated. Those 2 image below show the block behavior for character movements and then the codes.


Anyway i created a little example like i said with a 100×100 tile of 64pixel with a animated character moving around in few hour. That include the drawing of the tile set and figuring out how stencyl work without reading tutorials. Its very intuitive. But a beginner who doesnt know a thing about programming.. i dont think they will do much with this engine. You must have some base notion.

(move around using ASDW)
http://learnandplay.99k.org/test.html

And for the stencyl splash screen which have that bad of a notoriety… Just have to remove it, pretty sure no one will notice ;P

Anyway all this to say that im pretty happy to have found this. Will save a tons of time and headhach and debugging. I would recommend it to anyone like me that doesnt have a team to work with and want to see the work achieved quickly.

 
Flag Post

Topic: Game Programming / Looking for a SIMPLE Flash Program.. Ideas?

yeah i saw that just a blank project would create a 800kb file… (no image nothing…) kinda weird…

 
Flag Post

Topic: Game Programming / Looking for a SIMPLE Flash Program.. Ideas?

hmm i didnt know about stencyl heh its pretty nice… i tryed it yesterday for fun and was amazed by its power. I could use my tilesets, set up character and camera, walk around map using the collision detection from stencyl engine, i saw you could also write as3 code to it… AND all this in 30 minute, im very tempted to buy it. Is there any inconvenient about using stencyl? will i hit a wall at some point ?

 
Flag Post

Topic: Game Programming / Haxe 3 officially released!

and you write that language where? notepad?