square shooting
A downloadable game for Windows
Download NowName your own price
-Controls -Space to shoot -down Arrow to change look or -left mouse button to shoot -right mouse button to change look (Tip: you can use them together)
Download
Download NowName your own price
Click download now to get access to the following files:
square shooting.zip 27 MB
Comments
Log in with itch.io to leave a comment.
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public ScoreManager ScoreManager;
public AudioSource audioshoot;
public Transform playerTransform;
public GameObject projectilePrefab; // Reference to the projectile prefab
public Transform shootPoint; // Point from which the projectile will be shot
public Transform shootPoint2; // Point from which the projectile will be shot
public float shootCooldown = 0.0f; // Cooldown time between shots
private float shootTimer;
void Update()
{
if (Input.GetKeyDown(KeyCode.DownArrow))
{
transform.Rotate(0 ,180, 0);
}
if (Input.GetKeyDown(KeyCode.Mouse1))
{
transform.Rotate(0 ,180, 0);
}
shootTimer -= Time.deltaTime;
if (Input.GetButtonDown("Fire1"))
{
Shoot();
shootTimer = shootCooldown;
audioshoot.Play();
}
if (Input.GetKeyDown(KeyCode.Space))
{
Shoot();
shootTimer = shootCooldown;
audioshoot.Play();
}
}
private void Shoot()
{
if (ScoreManager.last)
{
Instantiate(projectilePrefab, shootPoint.position, shootPoint.rotation);
Instantiate(projectilePrefab, shootPoint2.position, shootPoint2.rotation);
}
if (ScoreManager.first)
{
}
Instantiate(projectilePrefab, shootPoint.position, shootPoint.rotation);
}
}
this is player control I used the score to make the bullet dubled
the bool (last) is from script named scoremanger
Hey, thanks for entering the jam! I see you put "miniscript" in the tags. Can you explain how this project uses MiniScript? Maybe share an example of some of the scripts involved?
(Feel free to reach out on Discord if you prefer to discuss there; my Discord ID is JoeStrout.)
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public ScoreManager ScoreManager;
public AudioSource audioshoot;
public Transform playerTransform;
public GameObject projectilePrefab; // Reference to the projectile prefab
public Transform shootPoint; // Point from which the projectile will be shot
public Transform shootPoint2; // Point from which the projectile will be shot
public float shootCooldown = 0.0f; // Cooldown time between shots
private float shootTimer;
void Update()
{
if (Input.GetKeyDown(KeyCode.DownArrow))
{
transform.Rotate(0 ,180, 0);
}
if (Input.GetKeyDown(KeyCode.Mouse1))
{
transform.Rotate(0 ,180, 0);
}
shootTimer -= Time.deltaTime;
if (Input.GetButtonDown("Fire1"))
{
Shoot();
shootTimer = shootCooldown;
audioshoot.Play();
}
if (Input.GetKeyDown(KeyCode.Space))
{
Shoot();
shootTimer = shootCooldown;
audioshoot.Play();
}
}
private void Shoot()
{
if (ScoreManager.last)
{
Instantiate(projectilePrefab, shootPoint.position, shootPoint.rotation);
Instantiate(projectilePrefab, shootPoint2.position, shootPoint2.rotation);
}
if (ScoreManager.first)
{
}
Instantiate(projectilePrefab, shootPoint.position, shootPoint.rotation);
}
}
this is player control I used the score to make the bullet dubled
Nice code! But it's C#, not MiniScript.