Skip to content

Instantly share code, notes, and snippets.

View bearlikelion's full-sized avatar

Mark bearlikelion

View GitHub Profile
@bearlikelion
bearlikelion / Weapon.gd
Created January 20, 2025 20:00
SurvivalScape's Enemy Targeting Code
func target_enemy() -> void:
Player.target_enemy = null
var enemies_in_range : Array[Area2D] = get_overlapping_areas()
if enemies_in_range.size() > 0:
enemies_in_range = enemies_in_range.slice(0, 100)
can_fire = true
for enemy : Node2D in enemies_in_range:
# Always target boss if in range
if enemy.is_in_group("boss"):
@bearlikelion
bearlikelion / captain-definition
Created January 9, 2025 16:24
Caprover static site deployment, looks for index.html in apache php 8.2
{
"schemaVersion": 2,
"templateId": "php/8.2.27"
}
@bearlikelion
bearlikelion / audio_manager.gd
Last active January 6, 2025 18:00
Godot Audio Manager Singleton
extends Node
enum Pitch {UP, DOWN, NONE, RANDOM}
var num_players: int = 8
var bus: String = "SFX"
var available: Array = [] # The available players.
var queue: Array = [] # The queue of sounds to play.
shader_type canvas_item;
uniform sampler2D noise_texture: repeat_enable, filter_nearest;
uniform sampler2D screen_texture: hint_screen_texture, repeat_disable, filter_nearest;
uniform vec2 position = vec2(0,0);
uniform float move_x = 1.0;
uniform float move_y = 1.0;
void vertex() {
// Called for every vertex the material is visible on.
}
@bearlikelion
bearlikelion / Log.gd
Last active February 11, 2025 18:51
Godot debug screen console autoload
extends Node
var debug: bool = OS.has_feature("debug")
@onready var panel: Panel = Panel.new()
@onready var canvas_layer: CanvasLayer = CanvasLayer.new()
@onready var rich_text_label: RichTextLabel = RichTextLabel.new()
# @onready var theme: Theme = load("res://SurvivalScape.theme") # Your custom theme file
func _ready() -> void:
@bearlikelion
bearlikelion / ServerVoipSettings.json
Created May 22, 2022 00:11
ServerVoipSettings.json
{
"VOIPEnabled": true,
"VOIPIssuer": "",
"VOIPSecret": "",
"VOIPAppUserId": "",
"VOIPAppUserPwd": "",
"VOIPVivoxDomain": "",
"VOIPAPIEndpoint": "",
"VOIPConversationalDistance": 14,
"VOIPAudibleDistance": 40,
@bearlikelion
bearlikelion / CVGUI
Created April 29, 2020 20:08
CVGUI.sh
#!/bin/bash
# Launch Commcell GUI on Linux
if [ "$EUID" -ne 0 ]
then
echo "Must run as root (sudo)"
notify-send "Must run as root (sudo)"
exit
fi
@bearlikelion
bearlikelion / launch.json
Last active January 22, 2020 16:24
CV TestCase vscode debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "CV TestCase",
"type": "python",
"request": "launch",
"program": "D:\\Program Files\\Commvault\\ContentStore\\Automation\\CVAutomation.py",
"args": [
"-tc", "${fileBasenameNoExtension}",
@bearlikelion
bearlikelion / Get-VMInfo.ps1
Created January 15, 2020 18:33
Get-VMInfo.ps1
# Script is designed to output all Hyper-V Virtual Machine
# Config file location and disks
$VMs = Get-VM
Foreach ($VM in $VMs)
{
Write-Output $VM.Name
Write-Output "---"
Write-Output $VM.ConfigurationLocation
Write-Output $VM.HardDrives.Path
Write-Output ""
@bearlikelion
bearlikelion / motd
Created January 7, 2020 19:31
Alpine Linux Dynamic MOTD
#!/bin/sh
#/etc/periodic/15min/motd
UPTIME_DAYS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 / 86400)
UPTIME_HOURS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 / 3600)
UPTIME_MINUTES=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 % 3600 / 60)
cat > /etc/motd << EOF
%--------------------------------------------------------------%
Hostname: `hostname`.`dnsdomainname`