Skip to content

Instantly share code, notes, and snippets.

@ZeroCool5254
ZeroCool5254 / imagePy.py
Last active May 3, 2024 11:44
This script will generate an image based on the prompts given. Can either generate an image based on the amount of grids in the x and y axis, or provide a resolution and it will attempt to generate a set amount of grids that fits in the area.
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):
@ZeroCool5254
ZeroCool5254 / Enemy.cs
Last active March 25, 2021 20:31
This is the code of my Space Shooter Course as covered and updated in my Medium Posts
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField, Header("Enemy Settings")]
private float _speed = 4.0f;
void Start()
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Laser : MonoBehaviour
{
[SerializeField]
private float _speed = 8.0f;
void Update()
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
[SerializeField]
private float _speed = 5f;
[SerializeField]
private GameObject _laserPrefab;