Skip to content

Instantly share code, notes, and snippets.

View thecocce's full-sized avatar

TheCocce thecocce

View GitHub Profile
package com.badlogic.drop;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class Drop extends Game {
SpriteBatch batch;
BitmapFont font;
// A* for libgdx that is simple but optimized.
package test;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public static int[][] rooms = new int[100][100];
public static void generate()
{
Random rndgen = new Random();
for(int i = 0; i <= 99; i++)
{
for(int j = 0; j <= 99; j++)
@thecocce
thecocce / proguard.cfg
Last active August 29, 2015 14:25 — forked from twyatt/proguard.cfg
An Android ProGuard configuration that works with libGDX.
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
package es.ephemerid.blackwood;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.utils.Align;
<?php
/*
SQLyog
Copyright 2003-2006, Webyog
http://www.webyog.com
HTTP Tunneling Page
This page exposes the MySQL API as a set of web-services which is consumed by SQLyog - the most popular GUI to MySQL.
@thecocce
thecocce / Bird.js
Created October 23, 2015 13:28 — forked from ada-lovecraft/Bird.js
Phaser 2.0 Tutorial: Flappy Bird (Part 2) : Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-2/
/* Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-2/ */
'use strict';
var Bird = function(game, x, y, frame) {
Phaser.Sprite.call(this, game, x, y, 'bird', frame);
this.anchor.setTo(0.5, 0.5);
// add flap animation and begin playing it
this.animations.add('flap');
this.animations.play('flap', 12, true);
@thecocce
thecocce / Bird.js
Created October 23, 2015 13:30 — forked from ada-lovecraft/Bird.js
Phaser 2.0 Tutorial: Flappy Bird (Part 3) :: Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-3/
/* Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-3/ */
'use strict';
var Bird = function(game, x, y, frame) {
Phaser.Sprite.call(this, game, x, y, 'bird', frame);
this.anchor.setTo(0.5, 0.5);
this.animations.add('flap');
this.animations.play('flap', 12, true);
@thecocce
thecocce / pipe.js
Created October 23, 2015 13:31 — forked from ada-lovecraft/pipe.js
Phaser 2.0 Tutorial: Flappy Bird (Part 4) :: Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-4/
/* Full tutorial: http://codevinsky.ghost.io/phaser-2-0-tutorial-flappy-bird-part-4/ */
'use strict';
var Pipe = function(game, x, y, frame) {
Phaser.Sprite.call(this, game, x, y, 'pipe', frame);
this.anchor.setTo(0.5, 0.5);
this.game.physics.arcade.enableBody(this);
this.body.allowGravity = false;
this.body.immovable = true;
/** Simple touch input helper class that provides similar data to HaxePunk's mouse.
takes arguments defining a box within which to register touches. Only registers first touch.
*/
class TouchInput{
public var pressed:Bool = false;
public var released:Bool = false;
public var down:Bool = false;
public var touchX:Float = 0;
public var touchY:Float = 0;