This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int p = _player.Count-1; p >= 0; p--) | |
{ | |
Player player = _player[p]; | |
player.UpdateLocalVertices(); | |
Rect playerRect = player.GetTextureRectRelativeToContainer(); | |
if(_player.Count == 0) break; | |
// Handle player/enemy collisions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(groupedMovement) | |
{ | |
// When hitting right side of the screen set direction to left | |
if(this.x > (Futile.screen.halfWidth - GMain.instance.gameScreenOffset) - (this.width / 2)) | |
{ | |
GMain.instance.enemyHorizontalDirection = "left"; | |
} | |
// When hitting left side of the screen set direction to right |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int p = _player.Count-1; p >= 0; p--) | |
{ | |
Player player = _player[p]; | |
player.UpdateLocalVertices(); | |
Rect playerRect = player.GetTextureRectRelativeToContainer(); | |
if(_player.Count == 0) break; | |
// Handle player/enemy collisions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class TestBed : MonoBehaviour { | |
private List<SquareOne> _squareOne = new List<SquareOne>(); | |
private List<SquareOne> _player = new List<SquareOne>(); | |
public List<SquareOne> returnObjects = new List<SquareOne>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class QuadTree { | |
private int MAX_OBJECTS = 1; | |
private int MAX_LEVELS = 3; | |
private int level; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private FLabel _title; | |
private string _text = "Hello this should\n be typing and yeah"; | |
private List<Background> _background = new List<Background>(); | |
private FContainer _hudHolder; | |
private FContainer _backgroundHolder; | |
override public void Start () | |
{ | |
_backgroundHolder = new FContainer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// original code.. | |
// | |
private void CreateEnemyEffect(Enemy enemy) | |
{ | |
Vector2 enemyPos = _effectHolder.LocalToLocal(enemy,Vector2.zero); | |
if(_ready) | |
{ | |
for (int i = 0; i < 10; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Laser/Enemy Collision detection | |
for(int i = _laser.Count-1; i >= 0; i--) | |
{ | |
Laser laser = _laser[i]; | |
Rect laserRect = laser.textureRect.CloneAndScaleThenOffset(laser.scaleX, laser.scaleY, laser.x, laser.y); | |
for(int ii = _enemy.Count-1; ii >= 0; ii--) | |
{ | |
Enemy enemy = _enemy[ii]; | |
Rect enemyRect = enemy.textureRect.CloneAndScaleThenOffset(enemy.scaleX, enemy.scaleY, enemy.x, enemy.y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HandleFire (FireButton fireButton) | |
{ | |
if(fireButton._isBeingTouched) | |
{ | |
CreateBullet(); | |
fireButton.alpha = 0.2f; | |
} | |
else if(!fireButton._isBeingTouched) | |
{ | |
fireButton.alpha = 0.1f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HandleMove (DPadButton dPadButton) | |
{ | |
if(dPadButton._direction == "left") | |
{ | |
GMain.instance.moveLeftPressed = true; | |
dPadButton.alpha = 0.2f; | |
} | |
if(dPadButton._direction == "right") | |
{ |