Skip to content

Fix style lockon #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion org/flixel/FlxCamera.as → src/org/flixel/FlxCamera.as
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ package org.flixel
w = target.width;
h = target.height;
}
deadzone = new FlxRect((width-w)/2,(height-h)/2 - h * 0.25,w,h);
deadzone = new FlxRect(((width-w)/2)+1,((height-h)/2)+1,w,h);
break;
default:
deadzone = null;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions org/flixel/FlxG.as → src/org/flixel/FlxG.as
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.flixel
{
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Bitmap;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.display.Stage;
Expand Down Expand Up @@ -37,7 +37,7 @@ package org.flixel
* Assign a minor version to your library.
* Appears after the decimal in the console.
*/
static public var LIBRARY_MINOR_VERSION:uint = 55;
static public var LIBRARY_MINOR_VERSION:uint = 56;

/**
* Debugger overlay layout preset: Wide but low windows at the bottom of the screen.
Expand Down
2 changes: 1 addition & 1 deletion org/flixel/FlxGame.as → src/org/flixel/FlxGame.as
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ package org.flixel
if(soundPrefs.bind("flixel"))
{
if(soundPrefs.data.sound == null)
soundPrefs.data.sound = new Object;
soundPrefs.data.sound = new Object();
soundPrefs.data.sound.mute = FlxG.mute;
soundPrefs.data.sound.volume = FlxG.volume;
soundPrefs.close();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion org/flixel/FlxSprite.as → src/org/flixel/FlxSprite.as
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ package org.flixel
var l:uint = _animations.length;
while(i < l)
{
if(_animations[i].name == AnimName)
if((_animations[i] as FlxAnim).name == AnimName)
{
_curAnim = _animations[i];
if(_curAnim.delay <= 0)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ package org.flixel.system
var output:String = seed+"\n";
var i:uint = 0;
while(i < frameCount)
output += _frames[i++].save() + "\n";
output += (_frames[i++] as FrameRecord).save() + "\n";
return output;
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ package org.flixel.system.input
var i:uint = 0;
while(i < _total)
{
var o:Object = _map[i++];
var o:KeyState = _map[i++];
if(o == null) continue;
if((o.last == -1) && (o.current == -1)) o.current = 0;
else if((o.last == 2) && (o.current == 2)) o.current = 1;
Expand All @@ -54,7 +54,7 @@ package org.flixel.system.input
var i:uint = 0;
while(i < _total)
{
var o:Object = _map[i++];
var o:KeyState = _map[i++];
if(o == null) continue;
this[o.name] = false;
o.current = 0;
Expand All @@ -78,7 +78,7 @@ package org.flixel.system.input
*
* @return Whether the key was just pressed
*/
public function justPressed(Key:String):Boolean { return _map[_lookup[Key]].current == 2; }
public function justPressed(Key:String):Boolean { return (_map[_lookup[Key]] as KeyState).current == 2; }

/**
* Check to see if this key is just released.
Expand All @@ -87,7 +87,7 @@ package org.flixel.system.input
*
* @return Whether the key is just released.
*/
public function justReleased(Key:String):Boolean { return _map[_lookup[Key]].current == -1; }
public function justReleased(Key:String):Boolean { return (_map[_lookup[Key]] as KeyState).current == -1; }

/**
* If any keys are not "released" (0),
Expand All @@ -102,7 +102,7 @@ package org.flixel.system.input
var i:uint = 0;
while(i < _total)
{
var o:Object = _map[i++];
var o:KeyState = _map[i++];
if((o == null) || (o.current == 0))
continue;
if(data == null)
Expand All @@ -122,8 +122,8 @@ package org.flixel.system.input
{
var i:uint = 0;
var l:uint = Record.length;
var o:Object;
var o2:Object;
var o:KeyData;
var o2:KeyState;
while(i < l)
{
o = Record[i++];
Expand Down Expand Up @@ -156,7 +156,7 @@ package org.flixel.system.input
var i:uint = 0;
while(i < _total)
{
var o:Object = _map[i++];
var o:KeyState = _map[i++];
if((o != null) && (o.current > 0))
return true;
}
Expand All @@ -172,7 +172,7 @@ package org.flixel.system.input
protected function addKey(KeyName:String,KeyCode:uint):void
{
_lookup[KeyName] = KeyCode;
_map[KeyCode] = { name: KeyName, current: 0, last: 0 };
_map[KeyCode] = new KeyState(KeyName, 0, 0);
}

/**
Expand All @@ -184,4 +184,4 @@ package org.flixel.system.input
_map = null;
}
}
}
}
14 changes: 14 additions & 0 deletions src/org/flixel/system/input/KeyData.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.flixel.system.input
{
public class KeyData
{
public var code:int;
public var value:int;

public function KeyData(Code:int, Value:int)
{
code = Code;
value = Value;
}
}
}
16 changes: 16 additions & 0 deletions src/org/flixel/system/input/KeyState.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.flixel.system.input
{
public class KeyState
{
public var name:String;
public var current:int;
public var last:int;

public function KeyState(Name:String, Current:int, Last:int)
{
name = Name;
current = Current;
last = Last;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ package org.flixel.system.input
*/
public function handleKeyDown(FlashEvent:KeyboardEvent):void
{
var object:Object = _map[FlashEvent.keyCode];
var object:KeyState = _map[FlashEvent.keyCode];
if(object == null) return;
if(object.current > 0) object.current = 1;
else object.current = 2;
Expand All @@ -196,7 +196,7 @@ package org.flixel.system.input
*/
public function handleKeyUp(FlashEvent:KeyboardEvent):void
{
var object:Object = _map[FlashEvent.keyCode];
var object:KeyState = _map[FlashEvent.keyCode];
if(object == null) return;
if(object.current > 0) object.current = -1;
else object.current = 0;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.flixel.system.replay
{
import org.flixel.system.input.KeyData;

/**
* Helper class for the new replay system. Represents all the game inputs for one "frame" or "step" of the game loop.
Expand Down Expand Up @@ -69,7 +70,7 @@ package org.flixel.system.replay

if(keys != null)
{
var object:Object;
var object:KeyData;
var i:uint = 0;
var l:uint = keys.length;
while(i < l)
Expand Down Expand Up @@ -124,7 +125,7 @@ package org.flixel.system.replay
{
if(keys == null)
keys = new Array();
keys.push({code:int(keyPair[0] as String),value:int(keyPair[1] as String)});
keys.push(new KeyData(keyPair[0], keyPair[1]));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion utils/config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PROJECT_NAME="flixel"
# output from `git describe`.
PROJECT_VERSION=auto

SOURCE_CODE_LOCATION="."
SOURCE_CODE_LOCATION="src"
LIBRARY_LOCATION="lib"

SWC_OUTPUT_LOCATION="bin"
Expand Down