Wednesday, 26 January 2011

Development

So after looking into my outside sources i had a basic idea of how i wanted my game to look and feel when the user interacted with it. To get use to the code of flash we made a demo came, a small racing demolition derby game in which we learnt fundmental basics of flash and the code to make an object move around a select path of our choice and cause to be effected by the environment of the game. Heres an Example of mine -


 Graphical View of the track and cars i Created


 The Code "using functions"  allows the user to control the car using the keyboard using fucntions for example


        if (Key.isDown(Key.UP) && this["speed"+who]<_root.maxSpeed) {
            this["speed"+who] += _root.acceleration;    <Determines how quick the car will moved>

if (Key.isDown(Key.LEFT) && this["speed"+who]>0.3) {
            _root["car"+who]._rotation -= _root.rotationStep*(this["speed"+who]/_root.maxSpeed);

<Determines which way the car should rotate when the left key is held down, Hopefully to the left. it controls how quick it rotates so essientailly it controsl the turn of how quick or slow the car will turn on its left>



 Variables of the car to allow the functions to know how quick it should accelerate, slow down, turn and its top speed and breaking speed.


This tell the game when on load display the car as neutral with no speed waiting for the players input to the game.



After the derby game I started to create coding for the game I intended to make for my final flash game, I need a piece of code that would generate objects on screen. I wanted to use the tower defense game as an example but i wanted my enemies/opponents to be randomly generated on screen ready to be shoot down by the player.


The idea was to get the opponent who was a student in my case to randomly appear on the screen up to ten times in random positions between the stage boundaries. Everytime one opponent was shoot down another would take its place. However i really struggeld to get the opponents to generated, it never seemed to display the student. I tried changing the class Id names, the instance names but no matter what i tried i could not get the code to related to the student image i had drawn for the game. With this set back I looked back at other games and came back to the Rock Paper Scissors game and explored it .

No comments:

Post a Comment