Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
YellowAfterlife / gamemaker_doc.user.js
Created January 31, 2016 12:48
Syntax highlighting for GameMaker: Studio' online manual.
// ==UserScript==
// @name GameMaker Manual' highlighting
// @namespace http://yal.cc
// @include http://docs.yoyogames.com/source/*
// @author YellowAfterlife
// @description Various improvements for GameMaker' manual ~ http://yellowafterlife.itch.io/gamemaker-manual-hinting
// @version 1.001
// @grant none
// ==/UserScript==
// built-in keywords:
@YellowAfterlife
YellowAfterlife / gamemaker_reddit.user.js
Last active November 24, 2017 19:34
A userscript that introduces syntax highlighting for code snippets posted on /r/gamemaker
// ==UserScript==
// @name /r/gamemaker syntax highlighting
// @namespace https://yal.cc
// @include http://www.reddit.com/r/gamemaker/*
// @include https://www.reddit.com/r/gamemaker/*
// @author YellowAfterlife
// @description Syntax highlighting for /r/gamemaker ~ http://yellowafterlife.itch.io/syntax-highlighting-for-gamemaker-reddit
// @license https://creativecommons.org/licenses/by-nc-sa/3.0/
// @version 1.100
// @grant none
#include <Windows.h>
#include <stdio.h>
#define dllx extern "C" __declspec(dllexport)
dllx double delay(double ms) {
Sleep((DWORD)ms);
return 1;
}
<html><head>
</head><body>
<div style="text-align: center">
<canvas width="640" height="360" id="canvas">
</canvas>
<br>Click to change tiles.
</div>
<script type="text/javascript">(function() {
(function() {
function $extend(superClass, fields) {
function base() { }
base.prototype = superClass;
var proto = new base();
for (var name in fields) proto[name] = fields[name];
if (fields.toString !== Object.prototype.toString) proto.toString = fields.toString;
return proto;
}
//{
import js.Browser.*;
import js.html.CanvasElement;
import js.html.CanvasRenderingContext2D;
import js.html.HTMLDocument;
import js.html.MouseEvent;
import sf.test.Test.Entity;
/**
* @author YellowAfterlife
* http://yal.cc/top-down-bouncing-loot-effects/
@YellowAfterlife
YellowAfterlife / Test.hx
Created December 24, 2015 09:10
Messing with various small code transformations in CustomJSGenerator.
import js.Browser.*;
import js.html.CanvasElement;
import js.html.CanvasRenderingContext2D;
import js.html.HTMLDocument;
class Test {
static var canvas:CanvasElement;
static var context:CanvasRenderingContext2D;
static var images:Array<CanvasElement>;
static function reset() {
/// draw_circle_width(x, y, rad1, rad2, segments)
var _x; _x = argument0;
var _y; _y = argument1;
var r1; r1 = argument2;
var r2; r2 = argument3;
var sn; sn = argument4;
//
var i; i = 0;
draw_primitive_begin(pr_trianglestrip);
repeat (sn + 1) {
/* Note: set "Applies to" to "URLs on domain" "tweetdeck.twitter.com" */
/* */
.trends-column { display: none }
/* Ensure little borders for previews */
.mdl.s-full { width: calc(100% - 32px) }
/* Hide "unfollow" buttons from profile popup */
.prf-actions .s-following .follow-btn {
display: none;
}
.prf-actions .s-following .follow-combo:after {
@YellowAfterlife
YellowAfterlife / bbox_collision_line_move.gml
Created September 16, 2015 13:28
Movement code for GameMaker using bbox_ variables and collision_line calls.
if (keyboard_check(vk_left)) repeat (3) {
var _x = bbox_left - 1;
if (!collision_line(_x, bbox_top, _x, bbox_bottom, obj_solid, false, true)) x -= 1;
}
if (keyboard_check(vk_right)) repeat (3) {
var _x = bbox_right + 1;
if (!collision_line(_x, bbox_top, _x, bbox_bottom, obj_solid, false, true)) x += 1;
}
if (keyboard_check(vk_up)) repeat (3) {
var _y = bbox_top - 1;