Recent posts by gavisgone on Kongregate

Flag Post

Topic: Kongregate Multiplayer Games / [Heavens] FAQ and Tutorial

I think there should be some indication that you’re actually fighting in the arena, it looks exactly the same as pressing the fight button. There’s no mention of the bonus experience after winning in the arena either. Why not put it in parenthesis like 47xp +(bonus)=50xp or something.

 
Flag Post

Topic: Kongregate Multiplayer Games / [Heavens] FAQ and Tutorial

I see there is a medal for getting 6 of each coloured stone in a row. How is it possible to get more than 5 in a row if 3 in a row instantly disappear?

 
Flag Post

Topic: Game Programming / Board game.

Ha I’m getting ripped to shreds now. Yup I should have picked something simpler. I wasn’t aware how hard AS3 was to understand when I picked the game. It’s my first ever Flash module.

 
Flag Post

Topic: Game Programming / Board game.

Thanks I appreciate all of the help and time put in by other users to help me with this project. I was given the task to create a flash game of my choosing around a month ago and chose this board game. I had other projects in vb.net, HTML and DVD production to complete at the same time as well as exams to study for. In the class we were learning techniques for creating shoot em up games and principles of gravity in flash etc. Nothing really to do with this project. I didn’t realise how complicated this would be until I started really tackling the code around 10 days ago.
I appreciate that a lot of the code has been given to me by helpful users such as yourself, but not all of it and I will be referencing where I got help from in my evaluation report which I will write upon completion.

 
Flag Post

Topic: Game Programming / Board game.

Right I’ve got it working now so that player one can click a tile to add their colour, then the other player clicks and adds their colour.

So I just need to do one more thing. Being able to check that the player has made a winning move. 5 of their tiles in a row in any direction.
I’m thinking I’ll need to find the neighbouring index in the array in every direction each time a piece is played, then if it contains another piece of the same colour, move in that direction and count how many places it has moved until it equals 5. Could anyone show me how to do this please?

 
Flag Post

Topic: Game Programming / Board game.

That removing all children code makes my program crash for some reason.
Ah right so is that going to make it harder to complete the way it is now? It’s due tomorrow night so I just want to be able to hand in a 2 player that works.

Would the player variable be another integer such as 3? Or is it done with a boolean value? Clearly I’m not getting my head around this yet but I need to start making some fast progress before tomorrow.

EDIT If I change the code to removeChildAt(1) it removes the grid from the screen. But it says RangeError: Error #2006: The supplied index is out of bounds. in the output. Apart from that seems to work fine.

 
Flag Post

Topic: Game Programming / Board game.

How would I then swap to player 2 and place a differently coloured tile on the board, then swap back to player 1?

 
Flag Post

Topic: Game Programming / Board game.

Ok so mainBoard = new Array(); clears the array. And then I want to remove the squareMCs from the arrays. removeChild(squareMC); only removes the last Movie clip in the array. How would I clear the lot?

 
Flag Post

Topic: Game Programming / Board game.

Ah fantastic thanks. I have a home button which takes me to the first frame, (the main board is on the second frame) I want to remove the mainBoard array when I click on this button as the game grid is still on the screen when I go back to frame 1. I’ve tried mainBoard.splice(0); in the button function but it doesn’t do anything.

 
Flag Post

Topic: Game Programming / Board game.

Yeah I totally agree. Not looking for anything fancy, just a simple colour change so the player can see where their counter is going to be placed. I’m happy enough if the player counter is merely a different coloured square.
It’s crazy I’ve been trying to get onto actually getting the program to work but I’ve only just managed to place a 2d array of tiles on the stage that I can actually use!
Where do I use e.currentTarget so the event handlers work on every square on the grid?

 
Flag Post

Topic: Game Programming / Board game.

Ha ok success! Going to try to apply rollover/rollout effects to the entire board now. As only the bottom right square gets highlighted instead of every single one. Hmm a for loop somewhere?

 
Flag Post

Topic: Game Programming / Board game.

Ah I didn’t realise there was a way to get more detailed information on your errors thanks. It says its on line 26 which is this one.


mainBoard[0].push(level1, level2, level3, level4, level5, level6, level7, level8, level9, level10, level11, level12, level13, level14, level15);

 
Flag Post

Topic: Game Programming / Board game.

Great I think I’ve made all of the changes you suggested and updated my last post. I get the following error now.


TypeError: Error #1010: A term is undefined and has no properties.
	at Main/frame2()

Can you spot what I’ve missed out? Thanks.

 
Flag Post

Topic: Game Programming / Board game.

Thanks for your continued help BobJanova.
I can’t get the vector class to work, i get an error and the word vector isn’t blue unlike when I try it in CS4. How do i target FP10? Can I get similar results using graphics.drawRect? I’m not clear if I should be drawing the squares on the stage, turning them into movie clips then placing instances of them in the array. Or if I’m meant to create the squares in the code and place them into the array there.

 
Flag Post

Topic: Game Programming / Board game.

Thanks for your suggestions, they’re a big help. I’m using CS3, does the vector class exist in CS3? It’s not there in the code hints. What alternative could I use?
I think my structures wrong as well, I have 3 frames. The first is a start up page with instances of two buttons, one takes you to the second frame which is the player versus computer page, the other takes you to the third frame which has the same elements as the second frame. This is going to be the two player frame. All of the code is contained in the actions panel of each frame. So I should be using external as files instead? And and external class for the main board?
Anomandris – that’s amazing I read through that competition looking for tips, I’ll definitely ask you for help if that’s ok if and when I’m able to get the two player working.
This is for a uni project which is due on Friday. I chose the specification for the game myself thinking it would be a challenge. Now it’s a big fail if i don’t get it done on time as i can’t change the game specification that i’ve chosen.

 
Flag Post

Topic: Game Programming / Board game.

Hi, thanks. Sorry but how would I use this code? Not too clear what i- or j- are.

 
Flag Post

Topic: Game Programming / Board game.

Ah right, the code was based on a tutorial, I’ll start again if this isn’t the correct way. What would be the best way to set up a 15×15 grid of squares that I can place player counters on?

 
Flag Post

Topic: Game Programming / Board game.

Ok post edited.

 
Flag Post

Topic: Game Programming / Board game.

Does it not contain level 1 to level 15 arrays? Sorry it’s my first game, what would be the best way to set up the main board? Oops didn’t realise you could format the code my mistake.

 
Flag Post

Topic: Game Programming / Board game.

Hey there. I’ve just started out making a board game in AS3. Its a 15×15 grid of squares. It’s a two player game, sat at one computer, where each player takes their turn to place their counter on the board. The first player to manage to get 5 of their counter in a row (up-down,left-right or diagonally) wins the game.
I’ve created code for the grid.

var mainBoard:Array = new Array();
mainBoard.push(new Array());
var level1:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level2:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level3:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level4:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level5:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level6:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level7:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level8:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level9:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level10:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level11:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level12:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level13:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level14:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var level15:Array = new Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);

mainBoard0.push(level1, level2, level3, level4, level5, level6, level7, level8, level9, level10, level11,
level12, level13, level14, level15);
var path:int = 0;
var tileWidth:int = 35;
var tileHeight:int = 35;
var tileSpacing:int = 1;
for (var k in mainBoard0)
{
for (var i in mainBoard0[k]0)
{
var square:Shape = new Shape();
var squareMC:MovieClip = new MovieClip();
if (mainBoard0[k]0[i] == path)
{
square.graphics.beginFill(0×9CD55E);
square.graphics.drawRect(168, 90, tileWidth, tileHeight);
square.graphics.endFill();

}
squareMC.addChild(square);
squareMC.x = (i * (tileWidth + tileSpacing + tileSpacing)) + tileSpacing;
squareMC.y = (k * (tileHeight + tileSpacing + tileSpacing)) + tileSpacing;
addChild(squareMC);
}
}

So now I want to be able to start a game, have the tiles highlight when the mouse hovers over them, place the players counter on the board when they are clicked. Then swap to the other player who does the same. Then be able to check to see if a player has made a winning move.
I don’t know where to start, any help or advice would be appreciated.
Thanks in advance.