Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411509 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 11:52:04 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityJams & EventsCompetitionsAnti-Assembly flash shooter (finished with download)
Pages: [1]
Print
Author Topic: Anti-Assembly flash shooter (finished with download)  (Read 4593 times)
dustin
Level 6
*


View Profile
« on: November 19, 2009, 10:39:53 AM »

Please look down for the full post on how to use it...  It also has a link to the download but in case you don't feel like looking here it is...

http://dl.dropbox.com/u/3234887/Assembly1.zip


So the anti-assembly thing sounded fun and I thought I'd see how much stuff i could get done in my free time between projects.  Now onto the game!

Genre: it's kinda shumpy but I'm trying to leave it pretty open
Format: so it's a flash file that reads in an xml sheet which describes how the game works.  I'll explain the xml in a bit
Graphics: I don't really know what people would prefer here.  I could give out a the .fla file and you could change them in the flash ide, or I could load external .png files or something.  Which would people prefer?

So the way this thing works is it builds the "level" out of an xml file for example this it the example xml file I use

  1 <Scene>
  2     <Level>
  3         <Name>level1</Name>
  4         <Actor>
  5             <Type>Player</Type>
  6             <x>250</x>
  7             <y>400</y>
  8             <yMin>400</yMin>
  9         </Actor>
 10         <Actor>
 11             <Type>Enemy</Type>
 12             <vely>1</vely>
 13             <count>10</count>
 14             <movement>none</movement>
 15         </Actor>
 16         <Actor>
 17             <Type>Generator</Type>
 18             <vely>4</vely>
 19             <wait>30</wait>
 20             <movement>sinWave</movement>
 21         </Actor>
 22         <Actor>
 23             <Type>BulletProto</Type>
 24             <velx>0</velx>
 25             <vely>-10</vely>
 26         </Actor>
 27     </Level>
 28 </Scene>

Don't change the scene or level tags.  The type of the actor determines what object is created and the rest are variables for that object.  So here are all the types and variables

Player
x
y
health
speed
xMax
xMin
yMax
yMin
score
reload ( a reload of 4 means you can fire once every 4 frames)
Right now movement is arrows or awsd and space is fire.

Enemy
score (the score you get when you kill them could be negative)
health (how many hits it takes to kill it)
colHealth (how much health to take off the player when you collide with this enemy so -1 would mean if you get hit by this enemy your health gets decreased by 1)
period (for sin wave movement it affects your period a big number means slow)
amplitude (amplitude for sin wave movement note it's not in pixels)
x (defaults to be a random x value)
y (defaults to be a little above the top)
velx
vely (defaults to -10)
movement (the movement function right now I just have none which is normal or sinWave)
shoot (how the enemy shoots right now it's just none)

Generator
this will generate enemies so you can give it any of the enemies values and it will generate enemies with those values. in addition it has the property
wait (the delay between enemy creations)

BulletProto
this is the type of bullet that gets created when the player fires
x
y
velx
vely

Also any actor can have a value of count which just means it will create that many of that type of actor.

Some things you could do with this that might not be aparent at first
don't want the player to be able to move vertically? set the ymin and ymax to be equal
want a health giving power up? set the colhealth of an enemy to be positive
want a side scrolling shooter? set the bullet vely=0; and velx=10;
want to add things you shouldn't shoot? set the score of an enemy to be negative

Any way here is the demo running off that xml sheet so you can see how it works
http://www.kongregate.com/games/nitsud/custom-shooter


So what do people think needs adding, and how should I do the graphics loading?

Things I was thinking of adding and will if people are interested:
multiple levels
meters for health and ammo left
a collision function for enemies which runs when it dies
more movement and shooting functions
a background
a title screen
« Last Edit: November 28, 2009, 12:44:56 PM by dustin » Logged
dustin
Level 6
*


View Profile
« Reply #1 on: November 22, 2009, 10:11:58 AM »

OK got shooting going on as well as death

the three shooting functions are
singleShot (shoots one shot)
spreadShot (shoots numShot number of shots in an arc from startTheta to endTheta
wallShot (shoots numShot out in a wall in front of the enemy with startTheta and end Theta being the start and end values of the wall)

all of these rely on reload to depend on how often they shoot

Also a function can now be added for death so if you want something to spreadShot when it dies that will work.

Logged
dustin
Level 6
*


View Profile
« Reply #2 on: November 22, 2009, 03:11:31 PM »

woo hoo got png loading to work.

To Do before I do a first upload
title screen
nice example xml level
Logged
dustin
Level 6
*


View Profile
« Reply #3 on: November 23, 2009, 04:55:42 PM »

Got the title screen added in (feel a bit funny calling it that seeing as it's just a white square filling the screen).
Did some more testing and reworking so all my functions work.
Added a min/max x and y so you can have enemies stay on the screen if you want and not fly off the bottom.
Logged
dustin
Level 6
*


View Profile
« Reply #4 on: November 24, 2009, 10:58:21 AM »

Got the loading of images to a point where I like it.  You now give stuff an image location and it will load that as it's image (.png, .gif, .jpg all work).  It only goes and gets it the first time, after that it just copies the one you already loaded in.  Hopefully this is ok.  Since I haven't really gotten any feedback I think I'm just going to wrap it up and hope someone uses it.  Of course if anyone wants anything added just let me know.
Logged
dustin
Level 6
*


View Profile
« Reply #5 on: November 26, 2009, 12:07:22 PM »

I made a new demo to figure out how to load it up to a website.  It's in the first post under the same link.  I also made a new xml file to go with it which shows more of the features.  This is the xml file...

<Scene>
    <Level>
        <Name>level1</Name>
        <Actor>
            <Type>StartScreen</Type>
        </Actor>
        <Actor>
            <Type>Player</Type>
            <x>250</x>
            <y>400</y>
            <yMin>400</yMin>
            <image>files/player.png</image>
        </Actor>
        <Actor>
            <Type>Generator</Type>
            <vely>4</vely>
            <wait>50</wait>
            <movement>sinWave</movement>
            <shoot>singleShot</shoot>
            <death>spreadShot</death>
            <reload>30</reload>
            <image>files/enemy.png</image>
            <bulletImg>files/enemyBullet.png</bulletImg>
        </Actor>
        <Actor>
            <Type>Generator</Type>
            <vely>5</vely>
            <wait>35</wait>
            <toActivate>300</toActivate>
            <movement>none</movement>
            <yMax>200</yMax>
            <shoot>singleShot</shoot>
            <reload>30</reload>
            <image>files/enemy.png</image>
            <bulletImg>files/enemyBullet.png</bulletImg>
        </Actor>
        <Actor>
            <Type>Generator</Type>
            <vely>1.5</vely>
            <wait>60</wait>
            <toActivate>600</toActivate>
            <movement>none</movement>
            <health>10</health>
            <shoot>spreadShot</shoot>
            <numBullets>10</numBullets>
            <reload>60</reload>
            <image>files/enemy.png</image>
            <bulletImg>files/enemyBullet.png</bulletImg>
        </Actor>
        <Actor>
            <Type>Generator</Type>
            <vely>3</vely>
            <wait>300</wait>
            <toActivate>400</toActivate>
            <movement>none</movement>
            <health>-10</health>
            <shoot>singleShot</shoot>
            <bcolHealth>3</bcolHealth>
            <reload>20</reload>
            <image>files/enemy.png</image>
            <bulletImg>files/health.png</bulletImg>
        </Actor>
        <Actor>
            <Type>Generator</Type>
            <vely>0.5</vely>
            <wait>60</wait>
            <toActivate>100</toActivate>
            <movement>none</movement>
            <health>3</health>
            <shoot>singleShot</shoot>
            <bcolHealth>-5</bcolHealth>
            <reload>10</reload>
            <image>files/enemy.png</image>
            <bulletImg>files/enemyBullet.png</bulletImg>
        </Actor>
        <Actor>
            <Type>BulletProto</Type>
            <velx>0</velx>
            <vely>-10</vely>
            <image>files/bullet.png</image>
        </Actor>
    </Level>
</Scene>

In the next couple days I'll offer the download as well as instructions on how to upload it to the web/edit the xml file if you want to.
Logged
Sos
Level 8
***


I make bad games


View Profile WWW
« Reply #6 on: November 28, 2009, 06:00:46 AM »

Better be quick, The deadline's tommorow. (I vote to extend it tho) Nice work btw. Will it support sounds?
Logged

dustin
Level 6
*


View Profile
« Reply #7 on: November 28, 2009, 12:43:51 PM »

OK here goes the final instructions for using your own graphics in this game.

Option 1:The Easy way
Download the zip and change bullet.png,health.png,player.png etc. to be your own images (they are in the files folder).  Don't mess with the xml file at all.  Double click Main.swf and the game with your new graphics will run.

Option 2:Pretty easy way
Say you want to do the same as above but instead of only having 1 enemy image as I have you want multiple types of enemies.  Drag all your enemy images into the files folder now open up the file test in a text editor.  You will notice that there are tags called <image>.  Change those to be the correct file for example say you wanted to change the sin wave enemies to a image called sinEnemy.png.  you would change line 22...

<Actor>
 15             <Type>Generator</Type>
 16             <vely>4</vely>
 17             <wait>50</wait>
 18             <movement>sinWave</movement>
 19             <shoot>singleShot</shoot>
 20             <death>spreadShot</death>
 21             <reload>30</reload>
 22             <image>files/enemy.png</image>
 23             <bulletImg>files/enemyBullet.png</bulletImg>
 24         </Actor>

to this
<image>files/sinEnemy.png</image>
and then your good to go.

The hard way:

You want to customize everything you say?  Oh good well here's what you do.  All data for the game is stored in the file test.  To change it open it up in your favorite text editor.  There are 4 types of Actors,  Player, Generator, BulletProto, and Enemy.  To make a new actor you open with the actor tags
<Actor>
Then you list it's type
<Type>insert 1 of the 4 types here</Type>
then you list the properties of this particular actor
<x>200</x>
<y>100</y>
<image>myActor.png</image>
then you close the actor
</Actor>

now what properties do the actors have and what are they exactly well... here goes...

Player
The player is the player controlled ship.  He moves with arrow keys and wasd.  it's properties are as follows.
x
y
health
speed
score (if you wanted the player to start with some score)
reload ( a reload of 4 means you can fire once every 4 frames)
Right now movement is arrows or awsd and space is fire.

Enemy
An enemy is one single enemy.  This means you could plan out by hand all the enemies that would come but this would take a lot of time and I doubt any one will do it.  It has the properties.

score (the score you get when you kill them could be negative)
health (how many hits it takes to kill it)
colHealth (how much health to take off the player when you collide with this enemy so -1 would mean if you get hit by this enemy your health gets decreased by 1)
period (for sin wave movement it affects your period a big number means slow)
amplitude (amplitude for sin wave movement note it's not in pixels)
x (defaults to be a random x value)
y (defaults to be a little above the top)
velx
vely (defaults to -10)
movement (the movement function pick between none (moves at velx,vely) or sinWave)
shoot (how the enemy shoots singleShot,spreadShot,none)
death (what happens when the enemy dies it can be none, singleShot, or spreadShot)
reload (how often the enemy fires)
bvelx (the bullet x velocity)
bvely (the bullet y velocity)
startAngle (for spread shot the ship fires between this and endAngle defaults to 0)
endAngle (defaults to 180)
numBullets (for spread shot this is how many bullets the ship fires in the spread)
bcolHealth (how much a bullet hurts the player)
bulletImg (the image to use for this ships bullet)

Generator
this will generate enemies so you can give it any of the enemies values and it will generate enemies with those values. in addition it has the properties
wait (the delay between enemy creations)
toActivate (the delay before this generator starts running, this helps for a gradual build up of difficulty)
both of which are counted in frames.

BulletProto
this is the type of bullet that gets created when the player fires
velx
vely

All actors have the following properties
image the image to load for this actor
xMax, xMin, yMax, yMin which are the maximum values of x and y this actor can have
Also any actor can have a value of count which just means it will create that many of that type of actor.

Now lets look at an example
 14         <Actor>              this starts the actor
 15             <Type>Generator</Type> this says it's of type generator
 16             <vely>4</vely>    this is the y velocity of the enemies it creates
 17             <wait>50</wait>   it will wait 50 frames between creating enemies
 18             <movement>sinWave</movement> enemies move in a sin wave
 19             <shoot>singleShot</shoot>    enemies shoot a single shot
 20             <death>spreadShot</death>    on death enemies shoot a spread
 21             <reload>30</reload>          enemies reload every 30 frames (1 second)
 22             <image>files/enemy.png</image> the enemies image
 23             <bulletImg>files/enemyBullet.png</bulletImg> the enemies bullet image
 24         </Actor>     ends the actor
a lot of the properties here have not been mentioned which means that they will be set to their default value.

There is no sound support yet we'll see if I can get it working.  If anyone does anything with this I will also post instructions on how to upload it to kongregate etc.

So here it is...

http://dl.dropbox.com/u/3234887/Assembly1.zip

Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic