Play game
Apo's itch.io pageResults
Criteria | Rank | Score* | Raw Score |
Graphics | #3 | 3.625 | 3.625 |
Gameplay | #4 | 2.750 | 2.750 |
Winner | #6 | 2.750 | 2.750 |
Sound | #6 | 2.625 | 2.625 |
Ranked from 8 ratings. Score is adjusted from raw score by the median number of ratings per game in the jam.
Source Code
public class PlayerMove : MonoBehaviour
{
public static float gameSpeed;
private float count;
private float countSide;
private float countFire;
private int jumpCount;
private bool injump;
private bool onground;
private bool naprLeft;
private bool dead;
private Vector3 respawnPos;
private Vector3 respawnPosSide;
private GameObject Level;
private GameObject SideMove;
private Manager manager;
private SoundManager sm;
public GameObject fire;
void Start ()
{
Level = GameObject.FindGameObjectWithTag("lvl");
SideMove = GameObject.Find("SideMove");
manager = GameObject.Find("manager").GetComponent<Manager>();
sm = FindObjectOfType<SoundManager>();
respawnPos = transform.localPosition;
respawnPosSide = SideMove.transform.localPosition;
gameSpeed = 0.2f;
}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("heart"))
{
manager.AmmoUse(false);
other.GetComponent<BoxCollider>().enabled = false;
sm.Play("up");
}
if (other.CompareTag("Finish"))
{
dead = true;
manager.LoadNext();
}
if (other.CompareTag("Enemy"))
{
other.GetComponent<BoxCollider>().enabled = false;
other.GetComponent<MeshRenderer>().enabled = false;
dead = true;
StartCoroutine(deadPop());
}
}
void Update () {
if (!dead)
{
if (count > gameSpeed)
{
if (!injump)
{
Down();
}
else
{
Jump();
}
count = 0;
}
if ((Input.GetKey(KeyCode.UpArrow)||manager.up) && Check() && !injump)
{
jumpCount = 0;
injump = true;
Jump();
sm.Play("jump");
}
if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.RightArrow)||manager.left||manager.right)
{
if ((naprLeft && Input.GetKey(KeyCode.RightArrow)) || (!naprLeft && Input.GetKey(KeyCode.LeftArrow)))
{
countSide = 0.3f;
}
if (countSide > 0.15f)
{
countSide = 0;
Side(Input.GetKey(KeyCode.LeftArrow)||manager.left);
}
}
if ((Input.GetKey(KeyCode.Space)||manager.jump) && countFire > 0.4f)
{
Fire();
countFire = 0;
sm.Play("fire");
}
countFire += Time.deltaTime;
countSide += Time.deltaTime;
count += Time.deltaTime;
}
}
void Fire()
{
if (manager.AmmoUse(true))
{
if (naprLeft)
{
GameObject a = Instantiate(fire,
new Vector3(transform.localPosition.x - 1, transform.localPosition.y, transform.localPosition.z),
Quaternion.identity);
a.GetComponent<Fire>().Run(naprLeft);
a.transform.parent = Level.transform;
}
else
{
GameObject a = Instantiate(fire,
new Vector3(transform.localPosition.x + 1, transform.localPosition.y, transform.localPosition.z),
Quaternion.identity);
a.GetComponent<Fire>().Run(naprLeft);
a.transform.parent = Level.transform;
}
}
}
void Jump()
{
if (jumpCount < 2)
{
RaycastHit hit;
Vector3 endRay = new Vector3(transform.localPosition.x, transform.localPosition.y + 1, transform.localPosition.z);
if (Physics.Linecast(transform.localPosition, endRay, out hit))
{
if (hit.transform.CompareTag("ground"))
{
}
else if (hit.transform.CompareTag("Enemy"))
{
hit.transform.GetComponent<EnemyMove>().Stop();
dead = true;
StartCoroutine(deadPop());
}
else
{
transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y + 1, transform.localPosition.z);
}
}
else
{
transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y + 1, transform.localPosition.z);
}
jumpCount++;
}
else
{
jumpCount = 0;
injump = false;
}
}
void Side(bool left)
{
sm.Play("move");
if (left) ////// LEFT------------------
{
RaycastHit hit;
Vector3 endRay = new Vector3(transform.localPosition.x - 1, transform.localPosition.y, transform.localPosition.z);
if (Physics.Linecast(transform.localPosition, endRay, out hit))
{
if (hit.transform.CompareTag("ground"))
{
}
else if (hit.transform.CompareTag("Enemy"))
{
hit.transform.GetComponent<EnemyMove>().Stop();
dead = true;
StartCoroutine(deadPop());
}
else
{
naprLeft = true;
SideMove.transform.localPosition = new Vector3(SideMove.transform.localPosition.x + 1, SideMove.transform.localPosition.y, SideMove.transform.localPosition.z);
}
}
else
{
naprLeft = true;
SideMove.transform.localPosition = new Vector3(SideMove.transform.localPosition.x + 1, SideMove.transform.localPosition.y, SideMove.transform.localPosition.z);
}
}
else ////RIGHT---------------------------------
{
RaycastHit hit;
Vector3 endRay = new Vector3(transform.localPosition.x + 1, transform.localPosition.y, transform.localPosition.z);
if (Physics.Linecast(transform.localPosition, endRay, out hit))
{
if (hit.transform.CompareTag("ground"))
{
}
else if (hit.transform.CompareTag("Enemy"))
{
hit.transform.GetComponent<EnemyMove>().Stop();
dead = true;
StartCoroutine(deadPop());
}
else
{
naprLeft = false;
SideMove.transform.localPosition = new Vector3(SideMove.transform.localPosition.x - 1, SideMove.transform.localPosition.y, SideMove.transform.localPosition.z);
}
}
else
{
naprLeft = false;
SideMove.transform.localPosition = new Vector3(SideMove.transform.localPosition.x - 1, SideMove.transform.localPosition.y, SideMove.transform.localPosition.z);
}
}
}
bool Check()
{
RaycastHit hit;
Vector3 endRay = new Vector3(transform.localPosition.x, transform.localPosition.y - 1, transform.localPosition.z);
if (Physics.Linecast(transform.localPosition, endRay, out hit))
{
if (hit.transform.CompareTag("ground"))
{
return true;
}
}
return false;
}
void Down()
{
RaycastHit hit;
Vector3 endRay = new Vector3(transform.localPosition.x,transform.localPosition.y-1, transform.localPosition.z);
if (Physics.Linecast(transform.localPosition, endRay, out hit))
{
if (hit.transform.CompareTag("ground"))
{
onground = true;
}
else if (hit.transform.CompareTag("Enemy"))
{
hit.transform.GetComponent<EnemyMove>().Stop();
dead = true;
StartCoroutine(deadPop());
}
else
{
transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y - 1, transform.localPosition.z);
onground = false;
injump = false;
}
}
else
{
transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y - 1, transform.localPosition.z);
onground = false;
injump = false;
}
}
IEnumerator deadPop()
{
bool die = manager.Die();
sm.Play("dead");
GetComponent<BoxCollider>().enabled = false;
//GetComponent<MeshRenderer>().enabled = false;
yield return new WaitForSeconds(0.2f);
GetComponent<BoxCollider>().enabled = true;
// GetComponent<MeshRenderer>().enabled = true;
yield return new WaitForSeconds(0.2f);
GetComponent<BoxCollider>().enabled = false;
// GetComponent<MeshRenderer>().enabled = false;
yield return new WaitForSeconds(0.2f);
GetComponent<BoxCollider>().enabled = true;
//GetComponent<MeshRenderer>().enabled = true;
yield return new WaitForSeconds(0.2f);
GetComponent<BoxCollider>().enabled = false;
// GetComponent<MeshRenderer>().enabled = false;
yield return new WaitForSeconds(0.2f);
GetComponent<BoxCollider>().enabled = true;
// GetComponent<MeshRenderer>().enabled = true;
Respawn();
yield break;
}
public void Respawn()
{
sm.Play("load2");
//StopCoroutine(deadPop());
GetComponent<BoxCollider>().enabled = true;
transform.localPosition = respawnPos;
SideMove.transform.localPosition = respawnPosSide;
dead = false;
jumpCount = 0;
injump = false;
var a = GameObject.FindGameObjectsWithTag("Enemy");
foreach (var o in a)
{
o.GetComponent<BoxCollider>().enabled = true;
// o.GetComponent<MeshRenderer>().enabled = true;
}
var b = GameObject.FindGameObjectsWithTag("heart");
foreach (var o in a)
{
o.GetComponent<BoxCollider>().enabled = true;
// o.GetComponent<MeshRenderer>().enabled = true;
}
}
}
Leave a comment
Log in with itch.io to leave a comment.
Comments
This entry pushes the art of LCD games to the limit! Very carefully crafted and very good level design. The moving case is great! It could benefit from a zoom, like Gunslinger, tho. Challenging gameplay - will I ever pass Lvl 3?
And the mechanic for moving and jumping is excellent, you almost forget the movement by block...
This3D model looks pretty good – especially the display. There are even shadows under the lcd tiles...
nice use of the display :) and I like how it is 3D :)
wow the shadow is so cool, I wouldnt notice :)