Skip to content

Instantly share code, notes, and snippets.

View thecocce's full-sized avatar

TheCocce thecocce

View GitHub Profile
@thecocce
thecocce / ZoomCamera.as
Created February 21, 2016 19:31 — forked from emmettbutler/ZoomCamera.as
Zoom Camera implementation - fixes the FlxCamera issue where zooming a follow camera doesn't zoom directly onto the follow target. Same as http://bullettimeninja.blogspot.com/2011/09/zoom-camera.html , except this zooms to the exact center of the target, rather than the top left.
/**
* You will need to change the package name to fit your game
*/
package
{
import org.flixel.FlxCamera;
import org.flixel.FlxG;
/**
* ZoomCamera: A FlxCamera that centers its zoom on the target that it follows
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled
sc config diagnosticshub.standardcollector.service start= disabled
sc config dmwappushservice start= disabled
@thecocce
thecocce / fezrotate.js
Created January 3, 2016 21:18 — forked from veeenu/fezrotate.js
Fez-like world rotation
/*
* Procedurally generated Minecraft dirt texture.
*/
(function() {
var ctx, imgd;
ctx = document.getElementById('texture').getContext('2d');
imgd = ctx.createImageData(64, 64);
@thecocce
thecocce / FlxYarn.hx
Created December 14, 2015 19:58 — forked from robertpfeiffer/FlxYarn.hx
Flixel+Yarn base code for Ludum Dare
//COPYRIGHT (c) 2015 Robert Pfeiffer
//ALL RIGHTS RESERVED
package;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.text.FlxText;
@thecocce
thecocce / MainActivity.java
Created December 7, 2015 16:54 — forked from Draknek/MainActivity.java
OpenFL fix immersive mode fullscreen
package ::APP_PACKAGE::;
import android.os.*;
import android.view.*;
public class MainActivity extends org.haxe.lime.GameActivity {
@Override protected void onCreate (Bundle state) {
super.onCreate(state);
::if (WIN_FULLSCREEN)::
@thecocce
thecocce / FlxImmersive.md
Created December 7, 2015 10:25 — forked from leoncvlt/FlxImmersive.md
Immersive Sticky Mode Android Haxeflixel

####Using Immersive Sticky Mode (Android 4.4+)

The Immersive Mode on Android hides all system bars when the app is running, thus giving you access to the full width and height of the screen (this is useful for getting integer aspect ration when zooming).First you have to find the the template GameActivity.java file that the system uses to generate the apps code. Usually it is located at HaxeToolkit\haxe\lib\lime[currentVersion]\templates\android\template\src\org\haxe\lime then modify it to include

import android.view.KeyEvent; 

in the imports field, and

@thecocce
thecocce / JoystickControls.hx
Created December 1, 2015 15:45 — forked from smks/JoystickControls.hx
JoystickControls.hx
package smks.controls;
import flixel.ui.FlxAnalog;
import smks.player.Player;
/**
* @author Shaun Stone (SMKS) <shaunmstone@gmail.com>
* @shaunmstone
*/
class JoystickControls
{
@thecocce
thecocce / Confetti.hx
Created December 1, 2015 15:39 — forked from smks/Confetti.hx
Haxeflixel Confetti Example
package com.particles;
import flixel.effects.particles.FlxEmitter;
import flixel.effects.particles.FlxParticle;
import flixel.FlxG;
import flixel.group.FlxTypedGroup;
import flixel.system.FlxCollisionType;
import flixel.util.FlxRandom;
/**
Copy expressions with Haxe macro
@thecocce
thecocce / GameScene.hx
Created November 20, 2015 23:31 — forked from theRemix/GameScene.hx
Main class for HaxePunk with variable screen size for mobile, tablet, and desktop discussion: http://www.openfl.org/community/general-discussion/developing-multiple-devices-screen-sizes/
package scenes;
import com.haxepunk.Scene;
class GameScene extends Scene
{
public function new()
{
super();