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
Blackjack.QC.RuleReview.Session = Ext.extend( | |
/** | |
* The Constructor! | |
* @constructor | |
*/ | |
function( config ){ | |
this.addEvents({ | |
rulesParsed:true |
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
Blackjack.QC.RuleReview.Session = Ext.extend( | |
/** | |
* The Constructor! | |
* @constructor | |
*/ | |
function( config ){ | |
this.addEvents({ | |
rulesParsed:true |
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
HC = require 'lib.hardoncollider' | |
-- array to hold collision messages | |
local text = {} | |
-- this is called when two shapes collide | |
function on_collision(dt, shape_a, shape_b, mtv_x, mtv_y) | |
local player, floor | |
if shape_a == mouse then | |
player = shape_a |
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
1. Calculate the minimum translation vector for all coliding objects | |
2. Sum the x and y directions ( sum(x(n)) > 0 = right, sum(y(n)) > 0 = down, etc) | |
3. With the direction(s) from 3, select the directions that has the minimum displacement along one axis. For instance Down and Left. If you have one block that wants to correct you to the left and one that wants to correct you to the right, there will be no horizontal correction.This works great if you have more than one object to collide with. If you only have one object, the axis with the least displacement will be chosen and tried. | |
Scenario one object: Falling, high velocity on Y-axis, lower on X. Two pixel width in X-collision, 10 pixels at Y. X would be displaced. | |
4. Apply the minimum displacement to that axis, check for collisions. Modify the axis speed accordingly. If you hit make a top collision, the Y-Velocity should be set to zero if it is point upwards, otherwise leave it. | |
5. If there still are collision, apply the minimum displacement for the o |
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
var xxx = { | |
name: 'reptar' | |
} | |
var yyy = { | |
name: 'godzilla' | |
} | |
xxx.getBaz = function(){ | |
return this.name; |
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
function workIt(inputArray) { | |
putThingDown(inputArray); | |
var workedArray = reverseIt(flipIt(inputArray)); | |
alert("Worked array contains:" + workedArray); | |
} |
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
doodle = document.getElementById('hplogo'); | |
fakeEvt = {preventDefault:function(){}} | |
function getPowerVal(){ | |
if (ballCount==0){ | |
return 210; | |
} | |
if (ballCount < 31){ | |
return 120; |
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
Raphael.fn.connection = function (obj1, obj2, color, bg) { | |
if (obj1.line && obj1.from && obj1.to) { | |
line = obj1; | |
obj1 = line.from; | |
obj2 = line.to; | |
} | |
var bb1 = obj1.getBBox()//Bounding box of the connectFrom node | |
, bb2 = obj2.getBBox() //Bounding box of the connectTo node | |
, connectionPoints // potential connecting points on the edge of the objects |
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
from tastypie.fields import ToManyField | |
class ConditionalRelatedField(ToManyField): | |
truthy = set('1', 'true', 'yes') | |
def dehydrate_related(self, bundle, related_resource): | |
full = bundle.request.GET.get('include_entitites', '').lower() | |
if full not in self.truthy: | |
return related_resource.get_resource_uri(bundle) | |
else: |
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
myFramework = { | |
viewport: { | |
height: "800" | |
, width: "800" | |
, color: "#cdcdcd" | |
, components: [] | |
, render: function(){ | |
//Destory viewport if it already exists | |
var existingVp = document.getElementById('myFramework-viewport'); | |
if (existingVp){ |
OlderNewer