Skip to content

Instantly share code, notes, and snippets.

View joebentley's full-sized avatar

Joe Bentley joebentley

View GitHub Profile
@joebentley
joebentley / prepare-for-arxiv.py
Last active October 18, 2021 12:45
Put the generated bibliography directly into the tex file
#!/usr/bin/env python
"""
MIT License
Copyright 2021 Joe Bentley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@joebentley
joebentley / process-bibliography.py
Last active March 13, 2022 19:31
Process bibtex bibliographies automatically for journals
#!/usr/bin/env python
"""
MIT License
Copyright 2020 Joe Bentley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
{
"waves" : [
{
"enemies" : [
{
"type" : "straight",
"time" : 1.0,
"x" : 100
},
{
override public function update():void
{
/* This is all for the timing of spawns, it checks to see if the elapsed
* time is equal to or more than the time when it needs to spawn the entity
* (in seconds) and then deletes the entity from the Array */
var time:Number = elapsedFrames / 60; // Game runs at 60 fps, so we divide frames elapsed by 60 to get time in seconds
// We use a for loop to avoid compiler warnings about untyped vars...
for (var i:int = 0; i <= level.length - 1; i++)
public function LoadLevel():Array
{
var array:Array = new Array();
var xml:XML = new XML(LEVEL.data); // We have to call "LEVEL.data" to extract the data right
for each (var l:XML in xml.level)
{
for each (var e:XML in l.enemy)
{
if (e.@type == "straight" || e.@type == "wave") {