View Full Version : need advise on flash 'game'
rabsterb
05-16-2001, 11:11 AM
hi,
i've made a small actionscripted piece:
take a look at http://www.flash-i.com/actionscripted ...
continue to click until you get to 'colour' written in
blocks.
i don't know if this is possible or not but here's what i want to do.
all those little squares are basically a duplicate movie effect of a single square.
1) when you start the blocks on the csreen are all dark blue, but if you continue to rollover them, the eventually turn lgiht blue. Is there a way to detect when all of them are light blue, and direct to another page/display a message.
2) the next thing i'd like to do, is put in some sort of timing device that gives about 1 min to change colour of all the blocks, and if not goes to a 'game over' screen.
let me know if anyone knows how to do this,
kind regards,
jeev@flash-i.com
Hi..
Yes it is possible. Following is one example of how to accomplish it. The movie contains two textfields and two MC's, the first MC is a timer MC and contains a button and actionscripts, the second is the dup MC :
1) Place two dynamic textfields on your stage, name them 'gameTime' & 'message'.
2) Build the timer MC. Insert/New Symbol/Movie.
3) Add the following code:
a) Frame1:
stop ();
b) Frame2:
startTime = getTimer ();
c) Frame3:
timeNow = getTimer ();
minute = 60000;
timeDiff = timeNow-startTime;
if (timeDiff>=minute) {
_root.gameTime="Game Over!";
}
This sets the time for the game to one minute.
d) Frame4:
gotoAndPlay (3);
4) Now for the MC that will be duplicated. Insert/New Symbol/Movie.:
a) Frame1: Add a stop action and place the dark blue square graphic here.
b) Convert the dark blue square into a button symbol, then add this script:
on (rollOver) {
_root.count+=1;
gotoAndStop (2);
}
This action will , on roll over, turn the square to light blue and add one to the variable count. I originally thought of doing the color change using the color object but this seemed to suffice.
c) Frame2: Add a stop action and place the light blue square graphic here.
5) On your main stage, drag both MC's from the library, name your square MC 'square'.
6) Add the code that checks to see if all the dup's have been rolled over to either of the MC's:
onClipEvent (enterFrame) {
if (_root.count==10) {
_root.message="You win, all ten are now blue!";
}
}
There you have. Sorry to prattle on so much.
Good luck.
PS: Heres the duplication code I used for testing purposes. Placed on frame 1:
xpos = 20;
xspace = 50;
i = 1;
while (i<10) {
_root.square.duplicateMovieClip("newMc"+i, i);
_root["newMc"+i]._x = xpos;
xpos += xspace;
i++;
}
rabsterb
05-18-2001, 04:52 AM
thankyou so so much for the longg reply.
i'll definintely try it out, and post up what i come up with :)
kind regards,
jeev
Jesse
05-18-2001, 05:08 AM
Marx wins a golden smile for such a long post :)
Cheers
Jesse
rabsterb
05-20-2001, 12:07 PM
hi, i'm making this game which you can see at:
http://www.flash-i.com/hidden/plat2.html
what i want is to make a 'high scores' table - anyone know how i can do this. I've seen a coupl e done with cgi, but they look quite difficult to use. are there any without cgi?
comments about the game are most welcome :)
kind regards,
jeev
Jesse
05-21-2001, 04:47 AM
I like the game. It's in the typical style but good. High scores can be saved using a server-side script and a text file. It's that simple. You can write to a text file all the scores people get and then load it up at the start of each game play. If a score in the list is less than the score that player just got, throw it out.... do a search for "write text file php" on these forums.. there are plenty of threads discussing the method.
Cheers
Jesse
rabsterb
05-24-2001, 12:29 PM
hi,
following my first game which you can see at http://www.flash-i.com/supersheep.html - i now trying to take on something alittle more difficult, and i was wondering if anyone here could help me out.
basically, what i want to do is make a platform style game.
how i hope to achieve this is throught, when eg. user goes right, the background (ie. levels/plateforms + scenery) scroll past, giving the illusion that the player is moving along. What kind of code would i need to achieve this?
next thing i need to know is how to get muliple levels into a game. By levels i mean, e.g. there's the gournd, but maybe i want the player to be able to jump onto the top of a building or something... so i'd need to know a gravity script + a on hit collision detect.
last question (sorry for going on a bit :)
how can i achieve the effect that when the player is not moving - the characters feet remain still and do nothing, but when the eg. right arrow/left arrow is pressed, then the feet move, to simultae the effect that he is waking along?
any advice would be most appreciated :)
kind regards,
jeev
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.