Skip to content

Instantly share code, notes, and snippets.

View maxmonax's full-sized avatar
🏠
Working from home

Max maxmonax

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Alien2</title>
<meta name="description" content="" />
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
@maxmonax
maxmonax / Boot.ts
Last active February 20, 2017 19:15
Phaser ScaleManager on TypeScript
module BattleGoblins.Client {
export class Boot extends BasicState {
preload() {
this.load.atlasJSONArray('preloader', './assets/atlases/preloader.png', './assets/atlases/preloader.json');
}
create() {
this.stage.setBackgroundColor(0x0);
<?php
// Make sure that it is a POST request.
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) {
throw new Exception('Request method must be POST!');
}
// Make sure that the content type of the POST request has been set to application/json
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
public function isBlocked(): Boolean
{
if (_idnet != null && _idnet.type == 'protection') {
return _idnet.isBlacklisted();
}
return false;
}
@maxmonax
maxmonax / Preloader.ts
Created May 19, 2017 06:23
rotate pic div show
module PhaserTemplate.Client {
export class Preloader extends Phaser.State {
private dummyBar: Phaser.Sprite;
preload() {
var bg = new Phaser.Sprite(this.game, 0, 0, 'bg');
this.add.existing(bg);
this.dummyBar = new Phaser.Sprite(this.game, 0, 0);
@maxmonax
maxmonax / Main.as
Created June 14, 2017 11:48
AnimParser AS3
package
{
import by.blooddy.crypto.Base64;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.ByteArray;
/**
* ...
@maxmonax
maxmonax / Card3.ts
Created June 27, 2017 05:53
Memory card class
module PhaserGame.Client {
const TIME_OPEN = 350;
const TURN_WITH_ANIM = true;
export class Card3 extends Phaser.Sprite {
private dummyMain: Phaser.Sprite;
private dummyShirt: Phaser.Sprite;
private dummyFace: Phaser.Sprite;
private imgBack: Phaser.Sprite;
@maxmonax
maxmonax / index.html
Created July 19, 2017 10:27
Using web fonts in Phaser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
namespace TJSLoader {
const TYPE_ATLAS_JSON = 'atlasJSONArray';
const TYPE_TEXTURE = 'image';
export class Loader {
static instance: Loader = null;
// for atlases: { key: aKey, type: TYPE_ATLAS_JSON, img: imgFile, json: aJSONFile }
// for images textures: { key: aKey, type: TYPE_IMAGE, img: imgFile }
private loadData: any[] = [];
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;