Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
-unlocked doors will open from farther away
Browse files Browse the repository at this point in the history
  • Loading branch information
corytheboyd committed Apr 12, 2011
1 parent e327a92 commit feda35a
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 1,074 deletions.
2 changes: 1 addition & 1 deletion BotSec.as3proj
Expand Up @@ -8,7 +8,7 @@
<movie fps="60" />
<movie width="960" />
<movie height="480" />
<movie version="10" />
<movie version="11" />
<movie background="#808080" />
</output>
<!-- Other classes to be compiled into your SWF -->
Expand Down
Binary file modified assets/gfx/pause_menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/BotSec.swf
Binary file not shown.
4 changes: 2 additions & 2 deletions obj/BotSecConfig.old
Expand Up @@ -2,7 +2,7 @@
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
<!--Any modifications you make may be lost.-->
<flex-config>
<target-player>10.0.0</target-player>
<target-player>10.1.0</target-player>
<compiler>
<define append="true">
<name>CONFIG::debug</name>
Expand All @@ -14,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'4/10/2011'</value>
<value>'4/12/2011'</value>
</define>
<source-path append="true">
<path-element>C:\Users\corytheboyd\Dropbox\Flash Files\BotSec\src</path-element>
Expand Down
4 changes: 2 additions & 2 deletions obj/BotSecConfig.xml
Expand Up @@ -2,7 +2,7 @@
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
<!--Any modifications you make may be lost.-->
<flex-config>
<target-player>10.0.0</target-player>
<target-player>10.1.0</target-player>
<compiler>
<define append="true">
<name>CONFIG::debug</name>
Expand All @@ -14,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'4/10/2011'</value>
<value>'4/12/2011'</value>
</define>
<source-path append="true">
<path-element>C:\Users\corytheboyd\Dropbox\Flash Files\BotSec\src</path-element>
Expand Down
4 changes: 0 additions & 4 deletions scripts/mapgen/blueprint.oel

This file was deleted.

18 changes: 16 additions & 2 deletions src/GV.as
Expand Up @@ -8,20 +8,34 @@ package
import net.bloom.BloomLighting;
import net.blur.BlurCanvas;
import net.flashpunk.Entity;
import net.flashpunk.FP;
import net.flashpunk.graphics.Image;
import net.flashpunk.World;
import worlds.*;


public class GV
public class GV extends Entity
{
public static var WORLD:Vector.<Level> = new Vector.<Level>(); //stores all of the level tiles, generated by GameWorld
public static var WORLD:Array = new Array; //stores all of the level tiles, generated by GameWorld
public static var CURRENT_LEVEL:Level; //the currently loaded world tile
public static var PLAYER:Player; //the player
public static var INVENTORY:Array = new Array();
public static var EQUIPPED_WEAPON:Entity = null;

public static var BLUR_CANVAS:BlurCanvas = new BlurCanvas(GC.CURSOR_BLUR_LEVEL);
public static var ITEM_BLOOM_LIGHTING:BloomLighting = new BloomLighting(GC.BLOOM_AMOUNT, GC.BLOOM_QUALITY);

/*
* Returns reference to this object by matching the name
* */
public static function getLevelByName(name:String):Object
{
for each( var level:Level in WORLD )
{
if (level.levelName == name) return level;
}
FP.console.log('Unable to load level ' + name);
return null;
}
}
}
2 changes: 1 addition & 1 deletion src/Level.as
Expand Up @@ -128,7 +128,7 @@ package
grid.setRect(int(solid.@x) / 16, int(solid.@y) / 16, int(solid.@w) / 16, int(solid.@h) / 16, true);
}
}

/*
* Loads level from an oel (xml) file
* */
Expand Down
1,040 changes: 0 additions & 1,040 deletions src/MAP.as

This file was deleted.

36 changes: 18 additions & 18 deletions src/PauseMenu.as
Expand Up @@ -10,10 +10,7 @@ package
import net.flashpunk.World;

public class PauseMenu extends Entity
{
//The tiles to populate minimap with. [0] is dark, [1] is vistied
protected var minimap:Tilemap = new Tilemap(GC.GFX_MINIMAP_TILESET, 28, 14, 14, 14);

{
public function PauseMenu()
{
graphic = new Image(GC.GFX_PAUSE_MENU);
Expand All @@ -24,34 +21,37 @@ package
override public function added():void
{
FP.console.log('PAUSED');

super.added();
buildMinimap();
}

override public function removed():void
{
FP.console.log('UNPAUSED\n');

//super.removed();
}

protected function buildMinimap():void
{
FP.console.log('Loading minimap...');

var alphabet:Array = ("abcdefghijklmnopqrstuvwxyz").split("");
for ( var i:uint = 0; i < alphabet.length; i++ )
//creates minimap entity, offset to fit the pause menu graphic
var minimap:Entity = new Entity(16, 48);
var tiles:Tilemap = new Tilemap(GC.GFX_MINIMAP_TILESET, 28, 14, 14, 14);
minimap.graphic = tiles;
minimap.layer = -1;

const ROW_SIZE :uint = 20; //how many rows on map
var count :uint = 0;
var index :uint; //which tile to use

for each ( var level:Level in GV.WORLD )
{
for ( var j:uint = 1; j <= 20; j++ )
{
try
{
GV.WORLD.push( new Level( alphabet[i] + String(j) ) );
}
catch(e:Error) {/*Level has its own error checking*/}
}
index = level.visited? 1 : 0;
tiles.setTile( 0, 0, 1 );
count++;
}

world.add(minimap);

FP.console.log('...Minimap loaded!');
}

Expand Down
2 changes: 1 addition & 1 deletion src/doors/Door.as
Expand Up @@ -39,7 +39,7 @@ package doors
image.play('unlocked');
}

if ( collide(GC.PLAYER_TYPE, x, y) )
if ( collide(GC.PLAYER_TYPE, x + 45, y) || collide(GC.PLAYER_TYPE, x - 45, y) )
{
if ( !locked )
{
Expand Down
24 changes: 23 additions & 1 deletion src/doors/DoorH.as
Expand Up @@ -24,7 +24,29 @@ package doors

override public function update():void
{
super.update();
if (locked && !open)
{
type = GC.LEVEL_TYPE;
image.play('locked');
}
else if(!locked && !open)
{
type = GC.DOOR_TYPE;
image.play('unlocked');
}

if ( collide(GC.PLAYER_TYPE, x, y + 45) || collide(GC.PLAYER_TYPE, x, y -45) )
{
if ( !locked )
{
image.play('open');
open = true;
}
}
else if ( open )
{
image.play('close');
}
}

}
Expand Down
5 changes: 3 additions & 2 deletions src/worlds/GameWorld.as
Expand Up @@ -2,6 +2,7 @@ package worlds
{
import doors.Door;
import flash.filters.BlurFilter;
import flash.utils.getTimer;
import net.blur.BlurredGraphic;
import net.flashpunk.Entity;
import net.flashpunk.FP;
Expand All @@ -22,7 +23,7 @@ package worlds

public function GameWorld()
{
FP.console.enable();
//FP.console.enable();
//nuthin
}

Expand Down Expand Up @@ -51,7 +52,7 @@ package worlds
}

override public function update():void
{
{
//pause menu
if ( Input.pressed("PauseMenu") )
{
Expand Down

0 comments on commit feda35a

Please sign in to comment.