Skip to content

Commit

Permalink
Removed tweening from collision inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
NTaylorMullen committed Jul 14, 2013
1 parent b45217b commit cbc76a6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module CollisionInspector {
private _dragOffset: eg.Vector2d;
private _currentMousePosition: eg.Vector2d;
private _decreasingZIndex: number;
private _currentTween: eg.Tweening.Vector2dTween;

constructor(canvas: HTMLCanvasElement) {
super(canvas);
Expand Down Expand Up @@ -41,17 +40,6 @@ module CollisionInspector {

// Triggers when any button gets released within the game area
this.Input.Mouse.OnUp.Bind((clickEvent: eg.Input.IMouseClickEvent) => {
var savedObject = this._draggingObject;

this._currentTween = new eg.Tweening.Vector2dTween(this._draggingObject.Bounds.Position, this._draggingObject.Bounds.Position.Add(new eg.Vector2d(300, 100)), eg.TimeSpan.FromSeconds(1), eg.Tweening.Functions.Back.EaseInOut);
this._currentTween.OnChange.Bind((c) => {
savedObject.Graphic.Position = savedObject.Bounds.Position = c;
});
this._currentTween.OnComplete.Bind((t) => {
console.log(t.Elapsed.Milliseconds);
});
this._currentTween.Play();

// Reset all the dragging behaviors
this._draggingObject = null;
this._dragOffset = null;
Expand Down Expand Up @@ -84,10 +72,6 @@ module CollisionInspector {
rotateDirection: number,
difference: eg.Vector2d;

if (this._currentTween) {
this._currentTween.Update(gameTime);
}

// If we're currently dragging an object
if (this._draggingObject !== null) {
this._draggingObject.Move(this._currentMousePosition.Add(this._dragOffset.Negate()));
Expand Down

0 comments on commit cbc76a6

Please sign in to comment.