Skip to content

Instantly share code, notes, and snippets.

View syl3n7's full-sized avatar
🏠
Working from home

syl3n7 syl3n7

🏠
Working from home
View GitHub Profile
@syl3n7
syl3n7 / player.pde
Created March 23, 2023 00:46
player script
class Player {
//Properties
PImage img; //sprite normal
float posX, posY, tam, vel, health, dmg;
int level;
int counterB = 0;
boolean moveUp, moveDown, moveLeft, moveRight, moveUnLock; //booleanas para controlar o movimento do player
public ArrayList<Bullets> b1; //bullets
//Constructor
Player(String n, float x, float y) {
@syl3n7
syl3n7 / gist:23eb7a394e1140549e4b0aac01e5b842
Created January 15, 2023 15:08
Get Battery status and change sprite acordingly
void CheckBattery()
{
//if (menuPanel.activeSelf)
//{
//playername.text = PlayerPrefs.GetString("Name");
if (battery == BatteryStatus.Charging) batteryimg.sprite = Resources.Load<Sprite>("bateriaCharging");
else if (battery == BatteryStatus.Discharging) batteryimg.sprite = Resources.Load<Sprite>("bateriaDischarging");
else batteryimg.sprite = Resources.Load<Sprite>("bateriaFull");
//}
@syl3n7
syl3n7 / Unity Redimension Canvas
Created January 10, 2023 16:24
redimension unity screen / canvas with 9:16 proportions
using System;
using UnityEngine;
using UnityEngine.UI;
public class Redimension : MonoBehaviour
{
private float lastWidth;
private float lastHeight;
void Start()