View Full Version : [AS2] A lengthy problem - game design
Vagabond
02-14-2009, 04:05 AM
First, I'm not asking anyone to do my work for me, but this is a rather difficult project for me, so I thought the more eyes looking over my shoulder the better. I hope to pull from all of your collective wisdom, make a great game, and become a better game designer in the mean time.
That said: here's the game. Basically, think Space Invaders, but from the alien's perspective. You play a tetris-esque game where you assemble an invasion force with 4x4 blocks of invaders. Then, depending on what patterns you made, the invaders will gain special abilities.
Then, once that stage ends and your force is assembled (this stage is timed), the battle will begin where you watch your invasion force tick it's way down to the planet while the planet attempts to stop you a la Space Invaders (only here, the computer is manning the turret).
Now, I know, the Tetris Company is just a little bit defensive about their baby (that is, Tetris), and that they technically own the very feel of Tetris itself, so by proxy they own any game that looks or plays anything -like- Tetris... I'm just hoping this will be different enough to escape that little loop they got. If not, oh well, I'm gonna give it a shot anyway.
So in this thread I will post my notes and the problems I'm going to need to solve to get this working, and I would really appreciate any advice ya'll feel like giving; especially if you see a problem that I don't or if my solution will just make more problems than it will fix.
and on that desperate plea, let's begin...
Vagabond
02-14-2009, 04:07 AM
Here are some notes I've made while brainstorming this game:
- 2 stages: build and invade.
- - In between each stage a warning message scrolls the screen,
"Warning! An Enemy is Approaching!"
- Build time is controlled through variables.
- Each block of 4 invaders is set randomly.
- 2 types of basic invaders: offensive and defensive.
- different combination of invaders create new invaders.
- 4 types of extended invaders: Lazer, Reflector, Shielder, Spreader
- Lazer Invaders are made by joining 3 offensive invaders on a horizontal row
- - Lazer invaders can shoot lazers. (Only lazer invaders on the front row can shoot)
- Reflector Invaders are made by joining 3 offensive invaders on a vertical row
- - Reflector invaders can reflect enemy attacks
- Shielder Invaders are made by placing 4 defensive invaders in a square block.
- - Shielder Invaders can absorb many hits (how many hits is controlled through variables)
- Spreader Invaders are formed by creating an X with defensive invaders
- - Spreader Invaders spawn 2 invaders in front of them when a spreader invader is killed
- the players wins a round if their invaders land.
- at that point, any remaining invaders will boost the player's score
- - 100 points for stray attackers/defenders
- - 200 points for each laser invader multiplied by how many laser invaders are in a horizontal row
- - 200 points for each reflect invader multiplied by how many reflect invaders are in a vertical row
- - 500 points for each surviving shield invader
- - 1000 points for the defending invaders in spread formation
- - The remaining time from the build stage should be calculated into the score by 10 points per second remaining.
- - - these are all held in variables
- - - scores are also sent to an external file for writing to a database
- basically, each successive level has a different enemy (up to level 5) and each one will fight differently, thus requiring the user to change strategy.
- - The turret (like the one in Space Invaders) scrolls from left to right shooting bullets at a low frequency.
- - The mercenary fires three bullet bursts, shoots more frequently, and moves back and forth faster than the turret. Like the turret the mercenary mainly scrolls left to right over and over with one trick. Randomly, the Mercenary should move a short distance (1/5th of the screen) left, right, left, right while shooting.
- - The wizard shoots long cones of lightning that pierce though three invaders vertically. These take time to shoot so the wizard has to stand still before shooting the lightning bolt. If a laser shot from one of your Space Invaders hits the wizard while he is charging or the wizard has to start his charge all over. The wizard’s attack pattern should alternate from hiding behind shields and jumping out to charge/shoot lightning bolts.
- - The ninja throws a spread shot of ninja stars. The ninja should have a fast firing rate and fire often when it’s out in the open. The ninja’s AI should have it randomly alternate between “peeking out” (just stepping outside of a shield) and dashing while rapidly firing stars to one of the other shields.
- - The robot shoots slow firing explosive bullets that destroy the invader and the ones directly to the left and right. The robot should also randomly (50% change) bounce back every shot that hits it. Explosive bullets destroy reflect invaders, but before they are destroyed they fire a bullet back.
----------------------------------------------------------------------------------------------------
Problems to solve:
- Enemy AI... there are a lot of these and they get pretty complicated.
- Invader Package. Having the computer choose and group 4 invaders, then attach them to the stage for placement by the player
- Grouping functions. Specific groups of invaders gain different abilities.
Solutions:
- Enemy AI... break the screen into quadrants, program the AI to favor the quadrants that have the most space invaders in them when the attack function executes.
- Grouping Functions... maybe each sprite has a lead origin point for hit testing. Sprites test on each move to see if they are now hitting something...
put the user's invasion force inside a movie clip. This clip will handle the mass move and drop action. when this movie clip hits the stage bounds, it will drop the entire force, reverse direction, and increase speed (by accel_speed)
drop_delay will control the amount of time before each "block" of invaders is placed on the screen for the user to place in the force (newInvader1-4?)
The computer simply flips a coin and fills each slot with either invader A, or invader B (look up time delay functions)
----------------------------------------------------------------------------------------------------
XML variables: (the game will be controlled with an xml file so variables can be refined)
- Build_Time // the time given to the player for the build stage
- Move_Speed // the initial speed of the invaders' movement
- Accel_Speed // how fast the invaders' movement increases with each cycle
- Drop_Delay // the amount of time in between build drops during invasion stage
- Shield_Soak // the number of hits a shield invader can take before dieing
- time_bonus // how many points extra build time is worth (per second)
- inv_bonus // how many points extra invaders are worth
- lzr_bonus // how many points extra lazer invaders are worth
- ref_bonus // how many points extra reflector invaders are worth
- sld_bonus // how many points extra shielder invaders are worth
- spr_bonus // how many points extra spreader invaders are worth
----------------------------------------------------------------------------------------------------
Sprites:
- Invaders:
- 1 Mother ship (2x wide)
- 2 Offensive Invader
- - A Lazer Invader (red)
- - B Reflector Invader (blue)
- 3 Defensive Invader
- - A Shielder Invader (green)
- - B Spreader Invader (invert)
- Standard Enemies:
- 1 Turret
- 2 Mercenary
- 3 Wizard
- 4 Ninja
- 5 Robot
- Projectiles:
- 1 Lazer
- 2 Bullets
- 3 Lightning
- 4 Shiruken
- 5 Grenades
- Other:
- 1 Splash Screen
----------------------------------------------------------------------------------------------------
Kimchee
02-14-2009, 01:07 PM
I like your game idea. Twist on the norm is always fun...
I could answer about all of your questions; however, I don't want to answer them all. So instead of posting a huge long list of what your game needs, post single specific questions, one at a time.
Though fun to know what you are up to you don't have to be specific, for example you could say.
How can I create an object that has hit points and dies after being hit enough?
You would then get an answer like this:
Create an array to hold your units or enemys and then add instances of the units into the array like this.
function addBaddie(){
var enemy = new Baddie();
enemy.x = 200;
enemy.y = 200;
enemy.health = 3;
addChild(enemy);
enemyArray.push(enemy);
}
then with a stage listener do a for loop to see if the unit is hit.
for(var i = 0; i < enemyArray.length; i++){
//here is where your hittest would go. If true you would do the following.
enemyArray[i].health-=bulletDamage;
if(enemyArray[i].health<1){
removeChild(enemyArray[i]);
enemyArray.splice(i,1);
}
If not satisfied with the answer because it doesn't make sense ask questions about what you don't understand. For example...
What is an Array?
What is the .health doing? Is it a variable?
How does "for" work...ect.
Good luck and keep us posted about how your game is coming along :cool:
Vagabond
02-15-2009, 07:22 AM
Actually, that makes sense. One of the invaders will be able to take additional hits, but mostly it's one hit one kill.
The problem I'm facing right now is having the computer assemble the block of invaders that it will give you during the first stage. Like Tetris, but every block will be a square. The random side of it will be that each piece of that 2x2 sqare will be either an offensive invader or a defensive invader.
My thought was to have the computer essentially flip a coin to decide which invader to use, but the problem is putting the 4 of them together, maybe into a movie clip, that will then be dropped on the live stage for play. Except that can only happen after all of the invaders in the last block have settled.
In addition, if one side of the block hits something, it settles, but the other side can keep moving down if it didn't hit anything (until it reaches the bottom of the stage if nothing is there).
But if I'm using a movie clip to move all of them together, can I still have it do what I need, or will I have to code it so each invader is controlled independently, assigning the left and right arrow keys to move all 4 of them simultaneously. Which, to me, feels like a clumsy thing to code.
Kimchee
02-15-2009, 05:12 PM
All of you ideas would work. You could also just make 16 different mc of the possible configurations of invaders(there are 16 possible 2x2 squares with 2 diff invaders to choose from) and then randomly create instances of one of the sixteen.
Vagabond
02-18-2009, 08:47 PM
Here's another problem I'm struggling with.
I need the block of invaders to tick their way down the screen until they hit the bottom edge of the game limits, or another invader that has already been placed. I can do the hit test against the limits easy, but how do I stop them when they hit another invader unless I do a hit test against every invader that's on the screen at every tick?
Well, it's a grid, right? Each square within a grid can be represented by arrays within arrays. You can use that to keep track of whether each square is occupied and by what.
Vagabond
02-19-2009, 01:46 AM
Well, it's a grid, right? Each square within a grid can be represented by arrays within arrays. You can use that to keep track of whether each square is occupied and by what.
I think I understand. Make the entire stage a multidimensional array?
I could probably just test the next lower space to see if something occupies it, and if it does, then the piece stays put.
But when all 4 pieces are dropping, won't the game tell the top 2 pieces that something is occupying the lower spaces on each drop? That might make the game look glitchy by forcing a space between them
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.