This file contains 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
from PIL import Image, ImageDraw, ImageFont | |
def generate_grid_image(num_grids_x, num_grids_y, grid_size): | |
image_size = num_grids_x * grid_size, num_grids_y * grid_size | |
image = Image.new('RGB', image_size, color='white') | |
draw = ImageDraw.Draw(image) | |
font_size = 24 | |
font = ImageFont.truetype('arial.ttf', font_size) #replace arial.ttf with any font. The font needs to be in the same folder as this script | |
for i in range(num_grids_x): |
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Enemy : MonoBehaviour | |
{ | |
[SerializeField, Header("Enemy Settings")] | |
private float _speed = 4.0f; | |
void Start() |
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Laser : MonoBehaviour | |
{ | |
[SerializeField] | |
private float _speed = 8.0f; | |
void Update() |
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Player : MonoBehaviour | |
{ | |
[SerializeField] | |
private float _speed = 5f; | |
[SerializeField] | |
private GameObject _laserPrefab; |