Skip to content

Instantly share code, notes, and snippets.

View ggohierroy's full-sized avatar

Gabriel Gohier-Roy ggohierroy

View GitHub Profile
from random import randrange
class Ship:
sea = ""
aliveRounds = 1
fatigue = False
dead = False
def __init__(self, sea):
{
"id": 13953,
"description": "Sparmigiano 1",
"user": {
"id": 2461,
"name": "ggohierroy"
},
"players": [
{
"id": 2461,
{
"status": "active",
"actions": [
{
"type": "bid",
"entity": "Player 1",
"entity_type": "player",
"id": 1,
"company": "OBC",
"price": 0
@ggohierroy
ggohierroy / sprite.m
Created August 1, 2012 01:22
Sprite implementation
#import "Sprite.h"
@implementation Sprite
@synthesize textureInfo = _textureInfo;
@synthesize program = _program;
- (void)draw
{
NSLog(@"Drawing a sprite");
}
@ggohierroy
ggohierroy / spriteinterface.h
Created August 1, 2012 01:19
Sprite interface
#import <GLKit/GLKit.h>
#import "Entity.h"
#import "TextureCache.h"
#import "GLProgram.h"
#import "ProgramManager.h"
@interface Sprite : Entity
@property (strong, nonatomic) GLKTextureInfo *textureInfo;
@property (strong, nonatomic) GLProgram *program;
@ggohierroy
ggohierroy / TextureCache.m
Created August 1, 2012 01:14
Texture cache first phase
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface (.h)
#import <Foundation/Foundation.h>
#import <GLKit/GLKit.h>
@interface TextureCache : NSObject
+ (TextureCache*) sharedTextureCache;
- (GLKTextureInfo*)addImage:(NSString*)fileName;
@end
@ggohierroy
ggohierroy / programManager.m
Created July 31, 2012 03:59
Program Manager first phase
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface (.h)
#import "GLProgram.h"
@interface ProgramManager : NSObject
+ (ProgramManager*)sharedProgramManager;
- (GLProgram*)getDefaultProgram;
@end
@ggohierroy
ggohierroy / GLProgram.m
Created July 31, 2012 03:54
GLProgram first phase
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface (.h)
@interface GLProgram : NSObject
- (void)use;
- (id)initWithVertexShader:(NSString*)vertexShaderName fragmentShader:(NSString*)fragmentShaderName;
@end
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Implementation (.m)
@ggohierroy
ggohierroy / IntroScene.m
Created July 27, 2012 02:46
IntroScene
#import "IntroScene.h"
@implementation IntroScene
- (id)init
{
self = [super init];
if(self)
{
Sprite* sprite = [[Sprite alloc] init];
@ggohierroy
ggohierroy / director.m
Created July 27, 2012 02:40
Complete director
#import "Steve.h"
static Steve* _sharedDirector = nil;
@interface Steve()
@property (strong, nonatomic) EAGLContext *context;
@property (strong, nonatomic) Scene *nextScene;
@property (strong, nonatomic) Scene *currentScene;
@end