This file contains 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 LIGHT_COLOR = { r: 255, g: 128, b: 128 }; | |
var LIGHT_INTENSITY = 0.7; | |
var MAX_DIST = 8; | |
// Helper function that calculates a distance | |
function distance(x1, y1, x2, y2) { | |
return Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); | |
} | |
// Helper function that does blending between two values |
This file contains 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
/* globals TweenMax, Quad, Back, Elastic */ | |
/* | |
* Original implementation: https://codepen.io/wiledal/pen/ZYoNEa?editors=0010 | |
* Requires GreenSockss GSAP 2.0.1 | |
* Works with PixiJS 4.7.3 | |
*/ | |
export default class ScrollContainer { | |
constructor(x, y, width, height, itemHeight) { |
This file contains 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
/** | |
* Pick the closest portal. If advancing to it puts you in danger, pick the less dangerous portal instead. If it's the same, or it | |
* still endangers you, there's no escape portal | |
*/ | |
Enemy.prototype.getEscapePortal = function(){ | |
console.log('getEscapePortal'); | |
var portal = this.getClosestPortal(); | |
if (!portal){ | |
console.log('no closest portal'); |
This file contains 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
* Add about 77 new weapon types | |
* New reloading mechanics for bows (Can only load one arrow at a time, quick reloading by passing turn). Also applies for crossbows and slings. | |
* Add Dagger, Whip, Scythe, Sling, Crossbow weapon types | |
* Prevent wand and liquid ammo from being parried | |
* Change starting equipment for Hunter (bow and sword) | |
* Add item modifiers (Fire and Smite Undead) | |
* Make most classes start with a befriend monster spell | |
* Give evolve potion on level 5 | |
* Allow throwing pebbles | |
* Change number of enemies per level (independent of depth) |
This file contains 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
circular.registerClass('Player', Player, { | |
transients: { | |
gameController: true, | |
sprite: true | |
}, | |
reviver: function(object, reviverData){ | |
object.gameController = reviverData.gameController; | |
var gameController = object.gameController; | |
for (var i = 0; i < object.items.length; i++){ | |
var item = object.items[i]; |
This file contains 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
{"object":{"_c":{"type":"AnaniasGame","uid":158},"version":"1.22","player":{"type":"Player","uid":90}},"references":{"x158":{"_c":{"type":"AnaniasGame","uid":158},"version":"1.22","player":{"type":"Player","uid":90}},"x90":{"level":1,"hitPoints":{"type":"Stat","uid":88},"attack":{"type":"Stat","uid":89},"items":[{"type":"Item","uid":91},{"type":"Item","uid":94},{"type":"Item","uid":95}],"x":4,"y":3,"currentWeapon":{"type":"Item","uid":91},"currentArmor":{"type":"Item","uid":94},"carryCapacity":8,"knows":{"_c":{"isCircularSafe":true},"checkInventory":true},"isFriendly":true,"_c":{"type":"Player","uid":90},"facingLeft":true,"pet":{"type":"Enemy","uid":97},"dungeonLevel":{"type":"Level","uid":99},"currentRoom":{"type":"Room","uid":126},"itemAction":"USE"},"x88":{"max":40,"current":40,"_c":{"type":"Stat","uid":88}},"x89":{"max":3,"current":3,"_c":{"type":"Stat","uid":89}},"x91":{"code":"Quarterstaff","spriteIndex":384,"paperdollIndex":48,"name":"Quarterstaff","description":"Quarterstaff","onUse":"wield","_c":{"ty |