This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Player : MonoBehaviour, ITimed | |
{ | |
[SerializeField] | |
float speed = 1; | |
[SerializeField] | |
bool isStartingPlayer = false; | |
public bool IsStartingPlayer {get{return isStartingPlayer;}} | |
[SerializeField] | |
CollDetector forwardDetector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimedState | |
{ | |
SeriealizedState data; | |
ITimed timed; | |
public ITimed Target { get { return timed; } } | |
public SeriealizedState Data { get { return data; } } | |
public TimedState(ITimed timedObject, SeriealizedState serialized) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Timeline | |
{ | |
int currentFrame = 0; | |
public int CurrentFrame | |
{ | |
get { return currentFrame; } | |
set { currentFrame = value; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ITimed | |
{ | |
TimedState Serialize(); | |
void Hydrate(SeriealizedState state); | |
void Play(float time); | |
void ProcessAction(Action action); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum ActionEnum | |
{ | |
PressForward, | |
ReleaseForward, | |
PressRight, | |
ReleaseRight, | |
PressBack, | |
ReleaseBack, | |
PressLeft, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Action | |
{ | |
System.Object value; | |
public System.Object Value { get { return value; } } | |
ActionEnum type; | |
public ActionEnum Type { get { return type; } } | |
ITimed timed; | |
public ITimed Timed{get{return timed;}} | |
public Action(ITimed timedObj, ActionEnum actionEnum, System.Object valueToStore = null){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const transformData = dataArray =>{ | |
//transforms the data in some way | |
} | |
const dataToObj = dataArray =>{ | |
//converts the data to a new form | |
} | |
//The final object will be an object that contains all dependencies in this file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (io)=>{ | |
let roomID = 0; | |
let rooms = []; | |
let createRoom = function(id){ | |
roomID++; | |
let room = { | |
isFull: function(){ return this.sockets.length >= this.capacity;}, | |
capacity: 2, | |
sockets: [], | |
id : roomID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = (window)? window._ : require('underscore'); | |
const {sum} = (window)? window.util : require('./Util'); | |
const checkBounds = (body, world)=>{ | |
let {position:[posX, posY], extents: [extX, extY]} = body; | |
let {boundsMinX: minX, boundsMinY: minY, boundsMaxX: maxX, boundsMaxY: maxY} = world; | |
if((posX - extX) < minX){ | |
onCollision(body, null,{ | |
axis: 0, | |
offset: -(posX - extX - minX) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Item | |
import { h } from 'preact'; | |
import { appMethodsToProps } from '../appData'; | |
import { classNames } from '../../util'; | |
export default appMethodsToProps(({ clickOnItem, index, itemName, cost, selected, alreadyPaid })=> ( | |
<button | |
onClick={ ()=>clickOnItem(index) } | |
disabled={alreadyPaid} |