Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
YellowAfterlife / gamemaker_doc.user.js
Created Jan 31, 2016
Syntax highlighting for GameMaker: Studio' online manual.
View gamemaker_doc.user.js
// ==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 Nov 24, 2017
A userscript that introduces syntax highlighting for code snippets posted on /r/gamemaker
View gamemaker_reddit.user.js
// ==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
View WinDev.cpp
#include <Windows.h>
#include <stdio.h>
#define dllx extern "C" __declspec(dllexport)
dllx double delay(double ms) {
Sleep((DWORD)ms);
return 1;
}
View simple-iso.html
<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() {
View BouncingLootEffects.js
(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;
}
//{
View BouncingLootEffects.hx
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 Dec 24, 2015
Messing with various small code transformations in CustomJSGenerator.
View Test.hx
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() {
View draw_circle_width.gml
/// 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) {
View swickdeck.css
/* 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 Sep 16, 2015
Movement code for GameMaker using bbox_ variables and collision_line calls.
View bbox_collision_line_move.gml
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;