This file contains hidden or 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
import pygame,math; | |
class HUD: | |
def setChargeBars(self,leftBar,rightBar): | |
self.leftChargeAmount = leftBar; | |
self.rightChargeAmount = rightBar; | |
self.maxCharge = 100; | |
def setHealth(self,health,shield,ammo): | |
self.health = health; | |
self.shield = shield; |
This file contains hidden or 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
Public Class Form1 | |
WithEvents t As New Timer With {.Interval = 30} | |
Dim p As New Panel | |
Dim g As Graphics | |
Dim kp(50) As Boolean | |
Class obj | |
Function sp(ByVal i As Object, ByVal x As Object, ByVal y As Object) | |
Me.pt(i).X = CSng(x) | |
Me.pt(i).Y = CSng(y) | |
End Function |
This file contains hidden or 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
Public Class Form1 | |
WithEvents t As New Timer With {.Interval = 30} | |
Dim p As New Panel With {.Width = 500} | |
Dim g As Graphics | |
Dim kp(20) As Boolean | |
Dim canshoot As Integer = 0, canshoot2 As Integer = 0 | |
Dim blow1, blow2, blow1x, blow1y, blow2x, blow2y As Integer | |
Dim AI As Boolean = False | |
Public power1, power2, speed1, speed2, delay1, delay2 As Integer | |
Dim iz As Integer = 0, jz As Integer = 0 |
This file contains hidden or 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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains hidden or 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
/** | |
* clampAndSeparateStringInBlocks | |
* Separates a string in blocks by appending an separator character, and clamps the string to a desired length. | |
* | |
* @param {string} str input text | |
* @param {string} cfg.sep Separator, default "-" | |
* @param {number} cfg.len Desired length. Will slice if smaller than `str`, or prepend with `pad` if larger than `str` length. | |
* @param {number} cfg.siz Size (in characters) of each block. default 4 | |
* @param {string} cfg.pad Padding character, to prepend when `str.length < len`. Default "0". | |
* @returns string. |
This file contains hidden or 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
(function() { | |
function zeroFill(str, len, char) { | |
if ((str+"").length < len) { | |
return Array(len-(str+"").length).fill(char)+(str+"") | |
} | |
return (str+"") | |
} | |
function withVerifierDigits(numbers) { | |
numbers = numbers+"" |
This file contains hidden or 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
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"width": 300, | |
"height": 300, | |
"padding": { | |
"top": 20, | |
"left": 80, | |
"bottom": 40, | |
"right": 20 | |
}, |
This file contains hidden or 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
const getKey = inputName => (inputs[namedIndexesMap[inputName]] || {value:null}).value | |
//TODO gamepad | |
class InputMap { | |
constructor(inputName, type='', assignedKeyboardKeys=[], assignedGamepadButtons=[], assignedGamepadAxis=[]) { | |
const strArrayToKeyObj = arr => arr.reduce( (all,curr) => ({...all, [curr]: true}),{}) | |
if (inputName == null) { | |
throw TypeError("Input Name cannot be null or undefined ") | |
} |
This file contains hidden or 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
#!/bin/ksh | |
# | |
# @(69)$Id$ | |
# | |
# Helpful functions for your terminal | |
function git_branches() | |
{ | |
if [[ -z "$1" ]]; then | |
git_branches . |
This file contains hidden or 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
// Main "Lib" function | |
/** | |
* Executes a flow of callbacks passing inputs and storing outputs | |
* Example: jsAirflow( | |
* [ | |
* { fn: 'sum', in: ['v1', 'v2'], out: ['result'] }, | |
* { fn: 'power', in: ['result', 'power'], out: ['result'] }, |
OlderNewer