PDA

Click to See Complete Forum and Search --> : board game



emo_boy
09-10-2002, 11:41 PM
Dont know if this is the perfect forum to state my problem, but you guys can probably help... ok i have been working on it some more and came up with this

onClipEvent (load) {
move = true;
}
onClipEvent (enterFrame) {
if (this._x>=300) {
move = false;
} else {
this._x = this._x+5;
}
}

now this works fine. the clip stops moving once its x position is greater than or equal to 300, but the hard part is the corners. so i tried this

onClipEvent (enterFrame) {
if (hitTest(_root.cornerPiece)) {
this._y = this._y-5;
}
}

but it only moves up when it hits the movieclip called cornerPiece. i need to figure out how to get it to keep moving up. do you have any ideas????

BlinkOk
09-11-2002, 06:24 AM
emo_boy,
if you place your mc inside another mc (container) and place
the container clip on the main stage and center it (set it's x/y = 0). then you could limit the mc's movement by;


onClipEvent(load) {
step=5;
hEdge = 300;
vEdge = 200;
}

onClipEvent (enterFrame) {
var x, y;
x = _x + step;
y = _y + step;
if (Math.abs(_x) < hEdge)
_x = x;
if (Math.abs(_y) < vEdge)
_y = y;
}

this should limit the mc's horizontal movement to 0 - 600 and it's vertical movement to 0-400 (relative the the main stage)
i hope this is what you were looking for, if not just post.
BlinkOk

emo_boy
09-11-2002, 07:59 AM
thanks, BlinkOk, i'll see how that works and inform you...

emo_boy
09-19-2002, 12:18 AM
what im trying to do is say you roll a 3. the character moves 3 spaces. but the second space is a corner so he has to turn the corner. i have this code very kindly donated to me by BlinkOk from the fk forums


code:--------------------------------------------------------------------------------
onClipEvent(load) {
step=5;
hEdge = 300;
vEdge = 200;
}

onClipEvent (enterFrame) {
var x, y;
x = _x + step;
y = _y + step;
if (Math.abs(_x) < hEdge)
_x = x;
if (Math.abs(_y) < vEdge)
_y = y;
}


now the corner turns, but the pieces movent gets 'shifted' and the piece doesnt stop at the right spot.

i know this is kind of confusing.

THANKS!!!!

BlinkOk
09-19-2002, 02:57 AM
emo_boy,
1. is it a top-down, iso or 3d view?
2. do the players move around the edge and if so how many squares/edge?
BlinkOk

emo_boy
09-19-2002, 05:45 PM
top down, it's a monopoly game, so yes the move around/ turn conners, 11 squares on all sides (include both conners)
thanks for your help...

BlinkOk
09-20-2002, 03:41 AM
here is some movement code;
http://www.nlc.net.au/~oceana/games/m1.swf
http://www.nlc.net.au/~oceana/games/m1.fla
all the movement code is in the actions for each piece (which is a bit slack of me). the only diifference between each piece is it's number (0-3). i'm sure you can organize the code a bit better.
the code for the dice is in the _root (frame 1) and in the last frame of the dice mc.
hope this helps
BlinkOk
ps: click on the dice to roll

emo_boy
09-20-2002, 05:13 PM
wow, thanks so much, i'll let you know if i have anymore troubles!!