Skip to content

Instantly share code, notes, and snippets.

View grifdail's full-sized avatar

Julien Berthou grifdail

View GitHub Profile
@grifdail
grifdail / robot.js
Created December 7, 2012 12:58
George washington
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(10);
@grifdail
grifdail / robot.js
Created December 7, 2012 13:40
Marvin
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
//robot.clone()
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(10);
@grifdail
grifdail / bug.js
Created December 7, 2012 15:01
bug bizare JS
Data.Building = []
Data.Building[0] = {
image: (new Image()),//.src="Assets/tree.png",
printX: 0,
printY: 32,
printW: 32,
printH: 64,
map: [1],
width: 1,
height: 1,
@grifdail
grifdail / gist:4734470
Last active December 12, 2015 07:09
Essential for the GSP
{
"data": {
"author": "",
"website": "",
"about": ".",
"title": "",
"lang": "en-US",
"version": "1",
"date": "01-01-2013",
},
@grifdail
grifdail / gist:4734586
Last active December 12, 2015 07:09
node
"1":{
"text":"Hello",
"choices":{
"say hello back":2,
"kill him":3
}
},
@grifdail
grifdail / gist:4741616
Created February 8, 2013 20:13
Pour Xartok
function MainLoop() {
}
var compteur = 0
function MainLoop() {
Game.update();
Game.draw();
compteur++;
if (compteur>=60) {
compteur = 0
//ton code
@grifdail
grifdail / PathFinding.js
Created June 24, 2013 16:43
Game.passability(x,y) == true if there is an obstacle use PathFinding.go(startX,startY,endX,endY)
PathFinding = {}
PathFinding.go = function(sx,sy,ex,ey) {
this.list = []
this.Cl = []
this.ex = ex;
this.ey = ey;
this.sx = sx;
this.sy = sy;
var num = PathFinding.dist(sx,sy,ex,ey);
window.addEventListener("load",function () {
var postComment = document.getElementById('postComment')
postComment.addEventListener("submit",function(e) {
e.preventDefault();
var xhr = new XMLHttpRequest(),
data = new FormData(postComment);
xhr.open("POST","/postCom");
data.append("withJSON","true")
xhr.addEventListener("load",function() {
document.getElementById("submit").disabled = false;
@grifdail
grifdail / gist:6668690
Created September 23, 2013 10:19
Blink is dead, long live the blink tag !
blink {
@-webkit-animation: blink 2s infinite;
-o-animation: blink 2s infinite;
animation: blink 2s infinite;
}
@keyframes blink{
0% {opacity: 0;}
49% {opacity: 0;}
50%{opacity: 1;}