Hi guys, I am designing a flash game and I am having a bit of trouble with the Actionscripting, I wondered if you might be able to help me? I will try and explain how the game should function and I attach a JPG that shows the rough layout as well, hopefully from that you may be kind enough to point me in the right direction.
How it should function
The idea is you have a glass that you control, left and right keyboard arrows control left and right movements and it only moves on the _x axis and the _y axis always stays at it’s current value, this works fine and I have managed to add actionscript to the glass movieclip to do this, the movement also has gravity and friction which means the glass slides on a little even when you move to go the other way.
Using the Glass you need to collect falling object movieclips, there are two types, good and bad. When you catch the good it adds to your score and when you catch the bad it deducts from your score.
The falling objects need to be random and I have successfully managed to get 1 movieclip to fall by using actionscript code and also I have managed to set the _x position as random each time , the actionscript to do this has been applied to the falling object.
When the falling object hits the ground (which is also a movieclip) I want it to smash and the broken bits to stay at the bottom of the screen where it has smashed. This needs to apply to both the good and bad MCs.
There are three other hittests I would like, one is on the left edge of the rim of the glass and another on the right edge (this means that if the falling object does not fall in the middle of the glass and on the edge it will smash) the other is a hittest inside the glass that detects when the falling object has successfully landing inside, this also adds to the score.
To the left of the screen there is also a timer which acts a bit like a preloader bar, when it is complete ‘time up’ it will action a goto command.
My problem
I am new to programming like this in flash and so i am finding it quite difficult to understand some things, despite looking at several tutorials and forums online I just can’t seem to get the multiple objects falling. I basically want to create duplicate movieclips from the good and bad ones, be able to set their ‘fall speed’ and ‘frequency of objects to fall at any one time’ and then ensure that they each keep the same action properties to trigger the hittests and increase the score, each needs to smash still and they all need to work independently of each other. I did manage to get multiple objects to enter the stage but they all fell together in one line along _y. It needs to be a random fall.
As a guide the objects included are:
MC name: glass instance name: glass1 (MC that user controls)
MC name: good instance name: good1 (Falling object that adds to score)
MC name: bad instance name: bad1 (Falling object that subtracts from score)
MC name: ground instance name: ground1 (The ground where good/bad MCs smash)
MC name: rimL instance name: rimL1 (Left edge of glass, good/bad smash when in contact - hittest)
MC name: rimR instance name: rimR1 (Right edge of glass, good/bad smash when in contact - hittest)
MC name: caught instance name: caught1 (in glass and it hittests when good or bad falls in glass and then alters the score accordingly)
I think that’s all of them, but I may have missed something.
I hope you can help a bit with this, as I mentioned everything online seems to be confusing me and just needs explaining a bit clearer. Thanks in advance for any help you might be able to give me.
Terry