This file contains 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
INCLUDEPATH += "D:\portable\vs\vc\include" \ | |
"D:\portable\vs\sdk\Include\shared" \ | |
"D:\portable\vs\sdk\Include\ucrt" \ | |
"D:\portable\vs\sdk\Include\um" \ | |
"D:\portable\vs\sdk\Include\winrt" | |
LIBS += -L"D:\portable\vs\vc\lib\amd64" \ | |
-L"D:\portable\vs\sdk\Lib\um\x64" \ | |
-L"D:\portable\vs\sdk\Lib\ucrt\x64" |
This file contains 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 resize = () => { | |
let | |
w = window.innerWidth, | |
h = window.innerHeight, | |
l, t | |
// 横屏 | |
if (window.innerWidth / window.innerHeight >= 1) { | |
view.style.transform = 'rotate(0)' | |
window.GAME_ROTATE = 0 | |
if (window.innerWidth / window.innerHeight >= GAME_RATIO) { |
This file contains 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
PIXI.interaction.InteractionManager.prototype.mapPositionToPoint = function(point, x, y) { | |
let rect | |
// IE 11 fix | |
if (!this.interactionDOMElement.parentElement) { | |
rect = {x: 0, y: 0, width: 0, height: 0} | |
} else { | |
rect = this.interactionDOMElement.getBoundingClientRect() | |
} |
This file contains 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 | |
gulp = require('gulp'), | |
autoprefixer = require('gulp-autoprefixer'), | |
sass = require('gulp-sass'), | |
minify = require('gulp-minify-css') | |
gulp.task('default', function() { | |
gulp.src('bootstrap.scss') | |
.pipe(sass()) | |
.pipe(autoprefixer()) |
This file contains 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
// game.rotation: 画布的旋转角度,可简化为landscape | portrait | |
Object.defineProperties(phaser.Input.Pointer.prototype, { | |
x: { | |
get() { | |
return config.landscape ? this.position.y / this.manager.bounds.width * this.manager.bounds.height : this.position.x | |
}, | |
set(v) { | |
this.position.x = v |
This file contains 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
export default class Layout extends PIXI.Container { | |
static GRID = 2 | |
static VERTICAL = 1 | |
static HORIZONTAL = 0 | |
#added = false | |
constructor(option = {}) { | |
const { | |
gap, |
This file contains 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 sort<T>(list: Array<T>, cmp?: (a: T, b: T) => number) { | |
const {length} = list | |
if (length < 2) return list | |
cmp ??= (x, y) => (x as unknown as number) - (y as unknown as number) | |
let unit = 1 | |
let results = [] as Array<T> | |
while (length > unit) { |
This file contains 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
let seed = 1 | |
function seededRandom(max = 1, min = 0) { | |
seed = (seed * 9301 + 49297) % 233280; | |
let rnd = seed / 233280.0; | |
return min + rnd * (max - min); |
This file contains 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
/*** | |
* ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | |
* │Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│ ┌┐ ┌┐ ┌┐ | |
* └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └┘ └┘ └┘ | |
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ | |
* │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │ | |
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ | |
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │ │ | |
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │ | |
* │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter │ │ 4 │ 5 │ 6 │ │ |
This file contains 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
#define NUM_OCTAVES 3 | |
precision highp float; | |
varying vec2 vTextureCoord; | |
uniform sampler2D uSampler; | |
uniform vec4 inputSize; | |
uniform float t; |
OlderNewer