The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsAt 5/11/13 11:18 PM, kkots wrote: Why can't you just pick all tiles around the enemy and move to a random one every 5 seconds? What the hell is the freaking problem, dude!!!
Because that's what I'm having problem with? I'm not some badass coder like you are.
I have an arrangement of tiles that a player and an enemy are on.
public static var floor1:Array = new Array(7);
floor1[0] = [0,1,1,1,1,1,0];
floor1[1] = [1,1,1,1,1,1,1];
floor1[2] = [1,1,1,0,1,1,1];
floor1[3] = [1,1,0,0,0,1,1];
floor1[4] = [1,1,1,0,1,1,1];
floor1[5] = [1,1,1,1,1,1,1];
floor1[6] = [0,1,1,1,1,1,0];
public function Main()
{
var tilew:int = 60;
var tileh:int = 60;
for (var i:int=0; i<floor1.length; i++)
{
for (var u:int=0; u<floor1[i].length; u++)
{
var cell:MovieClip = new Tile();
cell.gotoAndStop(floor1[i][u]);
cell.x = ((u-i)*tileh);
cell.y = ((u+i)*tilew/2);
addChild(cell);
cell.addEventListener(MouseEvent.ROLL_OVER, mouseover);
cell.addEventListener(MouseEvent.ROLL_OUT, mouseout);
cell.addEventListener(MouseEvent.CLICK, mouseclick);
cell.addEventListener(Event.ENTER_FRAME, beginfloor1);
}
}
var player:Player = new Player();
addChild(player);
player.mouseEnabled = false;
player.x = 5 * (tileh);
player.y = 5 * (tilew/2);
var enemy:Enemy = new Enemy();
addChild(enemy);
enemy.mouseEnabled = false;
enemy.x = 9 * (tileh);
enemy.y = 9 * (tileh/2);
My goal is to have the enemy move randomly on tiles in his range. What I did was create a square graphic called enemyVisionArea that checks which tile is hitting the enemy, which is basically surrounding tiles.
I have a timer function that tells the enemy to move every 5 seconds if the player isn't near him and if he's next to an available tile.
function timerenemy (event:TimerEvent){
if (enemy.enemyVisionArea.hitTestObject(enemyMover) && !player.visionPoint.hitTestObject(enemyMover.tileMiddle))
{
enemy.x = (enemyMover.x)+55;
enemy.y = (enemyMover.y)+20;
trace("moved");
}
}
enemyMover is a variable that I made equal to the tile objects.
function beginfloor1(event:Event)
{
enemyMover = event.currentTarget as Tile;
}
It just stays where it is. I recently found out that the reason why it stays is because the enemyMover is checking one tile that the enemy is hitting instead of all available tiles the enemy is hitting. I'm not entirely sure on how to go about doing this. Any suggestions?
I couldn't do it. I'd get sick of the world.
At 8/4/10 11:16 PM, zmatt007 wrote: OK HERE if people say 2 atoms clashed together and poof the universe is made! THEN HOW THE FUCK DID THE ATOMS APPEAR IN THE FIRST PLACE EXPLAIN THAT U SMART ASSES
It wasn't God hurrdurr. That is what the Atheists would say.
Why did the atheist throw her watch out the window?
She wanted to see if it was designed intelligently enough to evolve into a bird.
Lol, ok that's the last one.
How many atheists does it take to change a light bulb?
Two. One to actually change the bulb, and the other to videotape the job so fundamentalists won't claim that god did it.
I'm literally crying right now.
Why did the atheist cross the road?
He thought there might be a street on the other side, but he wouldn't believe it until he tested his hypothesis.
HAHAHA
Dear Batman
I came in your mask
-Robin
Couldn't get a job, and waiting for my fall semester to begin, so might as well be a fucking loser on newgrounds to communicate with other losers until I get my life back on track.
real talk
At 8/3/10 09:53 PM, quagmire690 wrote: they wanted me to be a fucking door to door sales man...
no...
lol
You live in Canada, so of course you found a job.
Art History? Are you fucking kidding me!? It's a form of history. This is a failed attempt at trolling. Saving the punch line for the first ranked. Bullshit, I fucking actually took that class.
You know what, Drak and Josh wasn't so bad. They had Mindy Crenshaw, who I just realized is very good looking.
Everyone would have to post their dicks in this thread.
Don't use a rag with soap on it. If the soap gets insdie when you cum, that shit'll hurt for days.
It's a pillow, It's a pet, It's a pillow-pet
Not only is this commercial long, it portrays innocence, which will just be corrupted later on in life.
Probably Dick Rider. What am I implying about the mods exactly? hmm...
You both would have the same amount of money. However, if you had 5 bucks and the Old Spice Man had 5 bucks, the Old Spice man would clearly have more, seeing he can turn his 5 dollar bill into diamonds, making it worth over millions.
Fuck jobs, they're for the fucking lucky people.
At 7/20/10 08:36 AM, StCyril wrote:At 7/20/10 08:28 AM, Perversion wrote: Fox news.Yeah very nice, why dont you go back and listen to one of those Liberal media stations blame G Bush for Mel Gibsons rant some more.
CNN Same Article.
Oh, if CNN has the same article, I'll accept this story. In the future, remember FOX sucks cocks.
If there was a mouse in my house, I'd kill the little fucker.
I must smell failure, because I must be in South Park, Colorado.
The Los Angeles Lakers
Maybe everyone from Spain
At 7/18/10 03:26 PM, zen64 wrote:
Yeah, he's using a translator. Omran is an Arabian name apparently. Huh. That explains a lot.
That doesn't make him funny anymore
At 7/18/10 02:53 PM, Ronald-McDonald-LoL wrote:At 7/18/10 02:51 PM, Ptero wrote:I am going to link to these threads on my sig if he keeps posting at this level of genius.At 7/18/10 02:42 PM, Ronald-McDonald-LoL wrote: omran97 has done it again.He is my new favorite poster.
Another gem of quality BBS posting.
I sent the fucker a congratulation PM. What an inspiration.