Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

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

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-26-2001, 11:53 PM   #1
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Question

I am making a table for a strategy game.
10x10
i got info on the fields (owner, cities, troops, satelites) stored in an array, in the mc with instance name ins_arrays .
i got movie clip with instance ins_ispis , with four dynamic fields for displaying info about the field.
Now, i need advice. Do I make a 100 mc, tile them on the bg, and attach some code:
to check if the mouse is there and if it is. to pass the info to teh display...
Is this done with a collision detection or do i search for x and y of the mouse...


or can i duplicate 1mc 99 times, equip them with info 'bout the field...wait..then i must after 10th to go to next row...arse....

my brain is wreckin'

some advice? if you understod me, that is
RealBBoy is offline   Reply With Quote
Old 07-27-2001, 02:41 PM   #2
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Unhappy come on.....

*sigh*
RealBBoy is offline   Reply With Quote
Old 07-29-2001, 04:40 AM   #3
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

I don't understand your question. If you duplicate one clip which uses hitTest to check if the _xmouse and _ymouse are on it, you may get what you're after but 100 clip checking if they are being touched every frame is a lot of CPU time and your movie will prolly lag.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-29-2001, 05:27 PM   #4
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Thumbs up

Thas's what i think, too. Any advice how and where to store the data about the particular filed on the board?.

If u can't understand me just say so .
RealBBoy is offline   Reply With Quote
Old 07-30-2001, 07:58 AM   #5
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

I think the best idea would be to make the squares each a button (within an MC), that way you can add rollOver events to them and not have to loop and use hitTest. Laying them out is very easy... can you do that much yourself?
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-30-2001, 11:02 AM   #6
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Lightbulb

Quote:
Laying them out is very easy... can you do that much yourself?
Uh, i think i need some duplicate mc action, where i specifie the position of the duplicate..on every 10 pixels, or something like that.


Uh i am farely new to actionscript, but i want to learn.Realy. There is nothing much in Flash that i dont know, besides as.

Sorry if i am bothering ya'll.
RealBBoy is offline   Reply With Quote
Old 07-31-2001, 04:59 AM   #7
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

You could use a 'seed clip' and then duplicate it but I would be inclined to use attachMovieClip because it's neater. Here's some code I whipped up. I'm usinga 10px square and attachMovieClip (see the tutorial if you don't know how to use it):
Code:
// AttachMC Grid Layout Code
// Jesse Stratford, http://www.actionscripts.org
rows = 5;
cols = 3;
height = 10;
width = 10;
count = 10;
for (var r = 1; r<=rows; r++) {
	for (var c = 1; c<=cols; c++) {
		count++;
		name = 'clip'+r+'_'+c;
		_root.attachMovie('myClip', name, count);
		with (_root[name]) {
			_x = c*width;
			_y = r*height;
		}
	}
}
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-31-2001, 11:54 AM   #8
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Wink

thx, i will try it later...i didnt look into attachmovie lately. need to refresh memory.



RealBBoy is offline   Reply With Quote
Old 07-31-2001, 07:32 PM   #9
RealBBoy
..::juSt a gl!tcH;::.
 
RealBBoy's Avatar
 
Join Date: Jun 2001
Location: Belgrade, Jamaica..oh sorrey, Yugoslavia
Posts: 80
Send a message via ICQ to RealBBoy Send a message via AIM to RealBBoy Send a message via Yahoo to RealBBoy
Default

all right i tilled them but i want them to show at 0,0 position.

From this code they are tiling from 16 both for x & y. I tried with an "if elese" embeded in tiling proces for checking the first one and seting it on 0.0 position.

Hmm..then the second one pops on 32.32position. so i guess i need another variable to tile them right.

i tried like this but came nowhere:

Code:
onClipEvent (load) {
var_rows = 10;
var_cols = 10;
var_height = 16;
var_width = 16;
var_count = 10;
for (var r = 1; r<=var_rows; r++) {
	for (var c = 1; c<=var_cols; c++) {
		var_count++;
		var_name = 'tile'+r+'_'+c;
			if ( c = 1 ) {
				_root.attachMovie('tile', var_name, var_count);
				with (_root[var_name]) {
				_x = 0;
				_y = 0;
				}
				else {
					_root.attachMovie('tile', var_name, var_count);
					with (_root[var_name]) {
					_x = c*var_width;
					_y = r*var_height;
							}

				}
					}		

	}
}
}
[Edited by Veljko on 07-31-2001 at 03:58 PM]
RealBBoy is offline   Reply With Quote
Old 08-01-2001, 07:23 AM   #10
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

huh? if you're trying to get it to put an MC on the _y=0 and _x=0 lines then you just need to change both for loops to start at r=0 and c=0 rather than 1.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse 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


All times are GMT. The time now is 07:21 PM.


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