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 10-10-2001, 02:13 AM   #1
daverbalz
Registered User
 
Join Date: Oct 2001
Location: California
Posts: 14
Default Movie Clip postions

I'm making a sliding puzzle, and I want Flash to recognize when the puzzle is complete. The puzzle works but my code to recognize the completion of the puzzle doesn't. The way I wrote the code was for Flash to see if the MC were in the correct postion in relation to one another. Here is what I have, any suggestions will be appreciated:

if (_root[tile1].y=_root[tile2].y=_root[tile3].y=_root[tile4].y) {
if (_root[tile5].y=_root[tile6].y=_root[tile7].y=_root[tile8].y) {
if (_root[tile9].y=_root[tile10].y=_root[tile11].y=_root[tile12].y) {
if (_root[tile13].y=_root[tile14].y=_root[tile15].y) {
if (_root[ile1].y<_root[tile5].y) {
if (_root[tile5].y<_root[tile9].y) {
if (_root[tile9].y<_root[tile13].y) {
if (_root[tile1].x=_root[tile5].x=_root[tile9].x=_root[tile13].y) {
if (_root[tile2].x=_root[tile6].x=_root[tile10].x=_root[tile14].y) {
if (_root[tile3].x=_root[tile7].x=_root[tile11].x=_root[tile15].y) {
if (_root[tile4].x=_root[tile8].x=_root[tile12].x) {
if (_root[tile1].x<_root[tile2].x) {
if (_root[tile2].x<_root[tile3].x) {
if (_root[tile3].x<_root[tile4].x) {
gotoAndStop (2);
}
}
}
}
}
}
}
}
}
}
}
}
}
}

Last edited by daverbalz; 10-12-2001 at 03:17 AM..
daverbalz is offline   Reply With Quote
Old 10-10-2001, 06:28 AM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default welcome

your code seems a bit over kill just to see if the puzzle is complete. why not have a total_count for all pieces in the puzzle and every time some puts a piece in correctly you just decriment the count if total_count==0 then the puzzle is done.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 10-10-2001, 06:43 AM   #3
daverbalz
Registered User
 
Join Date: Oct 2001
Location: California
Posts: 14
Default

I don't believe I can use the total_count method becuse it isn't a jigsaw type puzzle. It's a sliding puzzle (all piece exist in a 4 x 4 gird with one open slot), so when a piece is in the right spot, it will have to be moved again until the total puzzle is complete.
Don't know if I'm explaing myself clearly.
daverbalz is offline   Reply With Quote
Old 10-10-2001, 09:17 AM   #4
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

How about if a tile is put in it's proper position, you increment a variable which at the beginning would be 0. If said var is == 15, if it's a number style puzzle, then we know we are done???
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 10-11-2001, 02:18 AM   #5
daverbalz
Registered User
 
Join Date: Oct 2001
Location: California
Posts: 14
Default

Actually its a picture puzzle so I don't think the number variables will work, but i'll give it a go.

Here is a look at what i'm after:

http://gettosake.com/theater/astroslide.html
daverbalz is offline   Reply With Quote
Old 10-11-2001, 01:45 PM   #6
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

Shouldn't matter at all, I should think...Of course this is just a suggestion...What I'm thinking is that you can increase a certain var when the piece is in it's proper position. Else, decrease it...If you've got the var == 15(or whatever the number of tiles), flash knows they are all in position.

Make sense? In my head it does. Now, how that gets down in code...How about a function to check? Pieces in an array...blah, blah...
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 10-12-2001, 03:17 AM   #7
daverbalz
Registered User
 
Join Date: Oct 2001
Location: California
Posts: 14
Default

I think I know what you mean now, I'll give it a go.

Thanks
daverbalz 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
scrolling slide show movie clip not working after is placed on the stage nikita26 ActionScript 2.0 2 08-02-2004 04:55 PM
scrolling slide show movie clip not working after is placed on the stage nikita26 ActionScript 2.0 2 07-30-2004 11:16 PM
movie clip control Kingman ActionScript 1.0 (and below) 2 06-13-2003 03:23 PM
Looping in a Movie Clip... HotZone2156 ActionScript 1.0 (and below) 10 10-24-2001 08:27 PM


All times are GMT. The time now is 05:43 AM.


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.