Skip to content

Instantly share code, notes, and snippets.

View domgetter's full-sized avatar

Dominic Muller domgetter

View GitHub Profile
@domgetter
domgetter / gist:7933643
Created December 12, 2013 19:10
Jotto full code to spec
print "Number of letters? "
input = gets.chomp.to_i
class String
def uniquely_lettered?
self.scan(/./).uniq.length == self.length
end
end
@domgetter
domgetter / heatseekingrocket.lua
Created December 17, 2013 13:37
basic incomplete code for the logic of a heat seeking rocket projectile.
function init(args)
end
function main()
if collision() then asplode() end
local found_monster = false
local sensor_range = 10
{
"animatedParts" : {
"stateTypes" : {
"boosting" : {
"default" : "off",
"states" : {
"off" : {
},
"on" : {
"properties" : {
{
"animatedParts" : {
"stateTypes" : {
"boosting" : {
"default" : "leftState",
"states" : {
"leftState" : {
"frames": 1,
"cycle" : 1,
"properties" : {
-- Ground Monster functions
position
setFlipped
baseHealth
animationStateProperty
setGravityEnabled
stopFiring
fly
randomizeParameterRange
-- inside damage()
status, err = pcall(function ()
for k,v in pairs(entity.velocity()) do
print("velocity: ",k, v)
end
end)
print(status)
print(err)
-- If you pass teh player ID to each of these world functions, these are the ones which do not throw an error. SOme of them don't make sense for obvious reasons, but this is the list.
callScriptedEntity nil
day 0
entityExists true
entityHealth table: 412366F0
entityName Le Bug
entityPosition table: 412366A0
entitySpecies glitch
entityType player
@domgetter
domgetter / gist:8073804
Created December 21, 2013 19:29
List of UI improvements desired
scroll wheel works when there is a scroll bar (im looking at you, character selection screen)
select one of something (or pop up number to grab from a stack)
place selected object in hotkey bar without having to move mouse all the way to that slot
ability to grab scroll bar and drag up and down.
"Take All" button for containers.
Inventory sorting (by type? category? rarity?)
Auto stack to defragment inventory
If window is moved, remember where window was next time it is opened
"C#" :[ 1, 3, 5, 6, 8, 10, 12 ],
"F#" :[ 1, 3, 5, 6, 8, 10, 11 ],
"B" : [ 1, 3, 4, 6, 8, 10, 11 ],
"E" : [ 1, 3, 4, 6, 8, 9, 11 ],
"A" : [ 1, 2, 4, 6, 8, 9, 11 ],
"D" : [ 1, 2, 4, 6, 7, 9, 11 ],
"G" : [ 0, 2, 4, 6, 7, 9, 11 ],
"C" : [ 0, 2, 4, 5, 7, 9, 11 ],
"F" : [ 0, 2, 4, 5, 7, 9, 10 ],
{
"keys" : {
"B LOCRIAN" : "C",
"BLOCRIAN" : "C",
"BLOC" : "C",
"F LYDIAN" : "C",
"FLYDIAN" : "C",
"FLYD" : "C",
"E PHRYGIAN" : "C",
"EPHRYGIAN" : "C",