Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-11-2007, 08:36 PM   #1
greendog
Registered User
 
Join Date: Mar 2007
Posts: 34
Send a message via AIM to greendog Send a message via Yahoo to greendog
Default [AS2] help creating peg solitaire game

I'm creating a peg solitaire game (ie.http://www.bannerblog.com.au/2007/05/peg_solitaire.php)
I have the stage all set, I'm just sitting here scratching my head on how to make it work.
Here's my code:
Code:
function newhole(libName, instName, size, xpos, ypos) {
	attachMovie(libName, instName, getNextHighestDepth());
	this[instName]._width = size;
	this[instName]._height = size;
	this[instName]._x = xpos;
	this[instName]._y = ypos;
}
function row(libName, instLett, maxrow:Boolean, firstNum:Number, row:Number) {
	if (maxrow == true) {
		newhole(libName, instLett+(firstNum), 16, 75, row);
		newhole(libName, instLett+(firstNum+1), 16, 100, row);
		newhole(libName, instLett+(firstNum+2), 16, 125, row);
		newhole(libName, instLett+(firstNum+3), 16, 150, row);
		newhole(libName, instLett+(firstNum+4), 16, 175, row);
		newhole(libName, instLett+(firstNum+5), 16, 200, row);
		newhole(libName, instLett+(firstNum+6), 16, 225, row);
	} else if (maxrow == false) {
		newhole(libName, instLett+(firstNum), 16, 125, row);
		newhole(libName, instLett+(firstNum+1), 16, 150, row);
		newhole(libName, instLett+(firstNum+2), 16, 175, row);
	}
}
row("holeMC", "h", false, 1, 50);
row("holeMC", "h", false, 4, 75);
row("holeMC", "h", true, 7, 100);
row("holeMC", "h", true, 14, 125);
row("holeMC", "h", true, 21, 150);
row("holeMC", "h", false, 28, 175);
row("holeMC", "h", false, 31, 200);
row("pegMC", "p", false, 1, 50);
row("pegMC", "p", false, 4, 75);
row("pegMC", "p", true, 7, 100);
row("pegMC", "p", true, 14, 125);
row("pegMC", "p", true, 21, 150);
row("pegMC", "p", false, 28, 175);
row("pegMC", "p", false, 31, 200);
unloadMovie("p17");
attachMovie("pegMC", "dragPeg", getNextHighestDepth());
this.dragPeg._x = 0;
this.dragPeg._y = 0;
this.dragPeg._width = 16;
this.dragPeg._height = 16;
this.dragPeg._alpha = 0;
greendog is offline   Reply With Quote
Old 05-03-2012, 09:11 AM   #2
elwina16
Registered User
 
Join Date: May 2012
Posts: 4
Default helow

sir can you attach your .fla sample of peg solitaire..
elwina16 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rate My Game, plz fill the questioner UzumakiJr Site Check 0 12-16-2006 08:48 PM
[AS2] Creating a drunken balancing game - but i cant make it hard to balance Irishmadman Gaming and Game Development 11 08-28-2005 01:56 AM
how would i go about creating a warioware type game? [email protected] Gaming and Game Development 1 03-27-2005 11:51 AM
[AS1] Creating a Game Timer LocoDave Gaming and Game Development 2 10-05-2004 12:17 PM


All times are GMT. The time now is 04:38 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.