Moved to graphical word bubbles

This commit is contained in:
2014-06-12 01:46:05 -07:00
parent 8aa5fb6d61
commit 155cc26caf
59 changed files with 296 additions and 97 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -40,7 +40,240 @@ var moonlightSettings = {
{ {
'name': 'simplelight', 'name': 'simplelight',
'path': 'gfx/lights/light-white-256px.png' 'path': 'gfx/lights/light-white-256px.png'
},
{
"name": "townsfolk-female/alerted/1.png",
"path": "gfx/bubbles/townsfolk-female/alerted/1.png"
},
{
"name": "townsfolk-female/alerted/2.png",
"path": "gfx/bubbles/townsfolk-female/alerted/2.png"
},
{
"name": "townsfolk-female/alerted/3.png",
"path": "gfx/bubbles/townsfolk-female/alerted/3.png"
},
{
"name": "townsfolk-female/alerted/4.png",
"path": "gfx/bubbles/townsfolk-female/alerted/4.png"
},
{
"name": "townsfolk-female/alerted/5.png",
"path": "gfx/bubbles/townsfolk-female/alerted/5.png"
},
{
"name": "townsfolk-female/alerted/6.png",
"path": "gfx/bubbles/townsfolk-female/alerted/6.png"
},
{
"name": "townsfolk-female/concerned/2.png",
"path": "gfx/bubbles/townsfolk-female/concerned/2.png"
},
{
"name": "townsfolk-female/concerned/3.png",
"path": "gfx/bubbles/townsfolk-female/concerned/3.png"
},
{
"name": "townsfolk-female/concerned/4.png",
"path": "gfx/bubbles/townsfolk-female/concerned/4.png"
},
{
"name": "townsfolk-female/concerned/6.png",
"path": "gfx/bubbles/townsfolk-female/concerned/6.png"
},
{
"name": "townsfolk-female/concerned/7.png",
"path": "gfx/bubbles/townsfolk-female/concerned/7.png"
},
{
"name": "townsfolk-female/losthim/3.png",
"path": "gfx/bubbles/townsfolk-female/losthim/3.png"
},
{
"name": "townsfolk-female/unaware/1.png",
"path": "gfx/bubbles/townsfolk-female/unaware/1.png"
},
{
"name": "townsfolk-female/unaware/3.png",
"path": "gfx/bubbles/townsfolk-female/unaware/3.png"
},
{
"name": "townsfolk-female/unaware/4.png",
"path": "gfx/bubbles/townsfolk-female/unaware/4.png"
},
{
"name": "townsfolk-female/unaware/5.png",
"path": "gfx/bubbles/townsfolk-female/unaware/5.png"
},
{
"name": "townsfolk-guard/alerted/1.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/1.png"
},
{
"name": "townsfolk-guard/alerted/2.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/2.png"
},
{
"name": "townsfolk-guard/alerted/4.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/4.png"
},
{
"name": "townsfolk-guard/alerted/5.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/5.png"
},
{
"name": "townsfolk-guard/alerted/7.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/7.png"
},
{
"name": "townsfolk-guard/alerted/8.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/8.png"
},
{
"name": "townsfolk-guard/alerted/9.png",
"path": "gfx/bubbles/townsfolk-guard/alerted/9.png"
},
{
"name": "townsfolk-guard/concerned/1.png",
"path": "gfx/bubbles/townsfolk-guard/concerned/1.png"
},
{
"name": "townsfolk-guard/concerned/2.png",
"path": "gfx/bubbles/townsfolk-guard/concerned/2.png"
},
{
"name": "townsfolk-guard/concerned/3.png",
"path": "gfx/bubbles/townsfolk-guard/concerned/3.png"
},
{
"name": "townsfolk-guard/concerned/5.png",
"path": "gfx/bubbles/townsfolk-guard/concerned/5.png"
},
{
"name": "townsfolk-guard/concerned/6.png",
"path": "gfx/bubbles/townsfolk-guard/concerned/6.png"
},
{
"name": "townsfolk-guard/losthim/2.png",
"path": "gfx/bubbles/townsfolk-guard/losthim/2.png"
},
{
"name": "townsfolk-guard/losthim/3.png",
"path": "gfx/bubbles/townsfolk-guard/losthim/3.png"
},
{
"name": "townsfolk-guard/losthim/4.png",
"path": "gfx/bubbles/townsfolk-guard/losthim/4.png"
},
{
"name": "townsfolk-guard/unaware/1.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/1.png"
},
{
"name": "townsfolk-guard/unaware/2.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/2.png"
},
{
"name": "townsfolk-guard/unaware/4.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/4.png"
},
{
"name": "townsfolk-guard/unaware/5.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/5.png"
},
{
"name": "townsfolk-guard/unaware/6.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/6.png"
},
{
"name": "townsfolk-guard/unaware/7.png",
"path": "gfx/bubbles/townsfolk-guard/unaware/7.png"
},
{
"name": "townsfolk-male/alerted/10.png",
"path": "gfx/bubbles/townsfolk-male/alerted/10.png"
},
{
"name": "townsfolk-male/alerted/11.png",
"path": "gfx/bubbles/townsfolk-male/alerted/11.png"
},
{
"name": "townsfolk-male/alerted/1.png",
"path": "gfx/bubbles/townsfolk-male/alerted/1.png"
},
{
"name": "townsfolk-male/alerted/2.png",
"path": "gfx/bubbles/townsfolk-male/alerted/2.png"
},
{
"name": "townsfolk-male/alerted/4.png",
"path": "gfx/bubbles/townsfolk-male/alerted/4.png"
},
{
"name": "townsfolk-male/alerted/5.png",
"path": "gfx/bubbles/townsfolk-male/alerted/5.png"
},
{
"name": "townsfolk-male/alerted/6.png",
"path": "gfx/bubbles/townsfolk-male/alerted/6.png"
},
{
"name": "townsfolk-male/alerted/7.png",
"path": "gfx/bubbles/townsfolk-male/alerted/7.png"
},
{
"name": "townsfolk-male/alerted/8.png",
"path": "gfx/bubbles/townsfolk-male/alerted/8.png"
},
{
"name": "townsfolk-male/alerted/9.png",
"path": "gfx/bubbles/townsfolk-male/alerted/9.png"
},
{
"name": "townsfolk-male/concerned/2.png",
"path": "gfx/bubbles/townsfolk-male/concerned/2.png"
},
{
"name": "townsfolk-male/concerned/5.png",
"path": "gfx/bubbles/townsfolk-male/concerned/5.png"
},
{
"name": "townsfolk-male/concerned/7.png",
"path": "gfx/bubbles/townsfolk-male/concerned/7.png"
},
{
"name": "townsfolk-male/losthim/6.png",
"path": "gfx/bubbles/townsfolk-male/losthim/6.png"
},
{
"name": "townsfolk-male/losthim/7.png",
"path": "gfx/bubbles/townsfolk-male/losthim/7.png"
},
{
"name": "townsfolk-male/unaware/1.png",
"path": "gfx/bubbles/townsfolk-male/unaware/1.png"
},
{
"name": "townsfolk-male/unaware/2.png",
"path": "gfx/bubbles/townsfolk-male/unaware/2.png"
},
{
"name": "townsfolk-male/unaware/3.png",
"path": "gfx/bubbles/townsfolk-male/unaware/3.png"
},
{
"name": "townsfolk-male/unaware/4.png",
"path": "gfx/bubbles/townsfolk-male/unaware/4.png"
},
{
"name": "townsfolk-male/unaware/6.png",
"path": "gfx/bubbles/townsfolk-male/unaware/6.png"
},
{
"name": "townsfolk-male/unaware/7.png",
"path": "gfx/bubbles/townsfolk-male/unaware/7.png"
} }
], ],
'spritesheets': [ 'spritesheets': [
{ {
@@ -169,113 +402,89 @@ var moonlightDialog = {
"status": { "status": {
"townsfolk-male" : { "townsfolk-male" : {
"unaware" : [ "unaware" : [
"I'd rather be fishing.", "townsfolk-male/unaware/1.png",
"Different day, same old stuff.", "townsfolk-male/unaware/2.png",
"Oi! Where'd that trouble run\noff to now then?", "townsfolk-male/unaware/3.png",
"The missus is off shoppin', and\nhere I am sittin' on\nme Jack Jones.", "townsfolk-male/unaware/4.png",
"Oy I'm gonna have a butchers at\nthat new tailor's knickers\nhe has for sale.", "townsfolk-male/unaware/6.png",
"I'm off to the pub to see the\nlads and chew the fat.", "townsfolk-male/unaware/7.png"
"♪ ♫ Whistling ♪ ♫"
], ],
"concerned" : [ "concerned" : [
"Wha… whats that? Whos there?", "townsfolk-male/concerned/2.png",
"Did you hear that?", "townsfolk-male/concerned/5.png",
"Either Im hearin things, or I\nneed to stop drinkin midday.", "townsfolk-male/concerned/7.png"
"Oi? I dont want no tomfoolery;\ncome out if youre there!",
"Must be them darned kids again.",
"Whats that?",
"Did you see that?"
], ],
"alerted" : [ "alerted" : [
"Don't you come no closer, you hear?", "townsfolk-male/alerted/10.png",
"Egads!", "townsfolk-male/alerted/11.png",
"I'm getting outta here!", "townsfolk-male/alerted/1.png",
"What's going on?!", "townsfolk-male/alerted/2.png",
"Holy bejeezus!", "townsfolk-male/alerted/4.png",
"Did you see that?", "townsfolk-male/alerted/5.png",
"What're you doing?!", "townsfolk-male/alerted/6.png",
"Get away!", "townsfolk-male/alerted/7.png",
"Get away from me!", "townsfolk-male/alerted/8.png",
"Stay away! I know Kung-fu! ... but\nthat would require bravery \nI don't have", "townsfolk-male/alerted/9.png"
"Guards! GUARDS!"
], ],
"losthim" : [ "losthim" : [
"Whew. Glad thats over.", "townsfolk-male/losthim/6.png",
"I wasnt scared!", "townsfolk-male/losthim/7.png"
"Mustve been intimidated by\nmy manly physique.",
"Thats right! Run away!",
"Aye, and dont-cha come back!",
"Spoony Bard...",
"Bloody wanker!"
] ]
}, },
"townsfolk-female" : { "townsfolk-female" : {
"unaware" : [ "unaware" : [
"My retro shake brings all the\nboys to the yard.", "townsfolk-female/unaware/1.png",
"I'm off to get my Barnet sorted\nout. Ill be the best looking\nlady at the gala.", "townsfolk-female/unaware/3.png",
"It's always all itsy bitsy with\nthem boys at the Rub-a-Dub.", "townsfolk-female/unaware/4.png",
"I need to get this shopping\nsorted out.", "townsfolk-female/unaware/5.png"
"What a lovely evening. Perfect\nfor skulking, I would imagine."
], ],
"concerned" : [ "concerned" : [
"Wha… whats that? Whos there?", "townsfolk-female/concerned/2.png",
"Did you hear that?", "townsfolk-female/concerned/3.png",
"Martha? Is that you?", "townsfolk-female/concerned/4.png",
"I don't want no tomfoolery.\nGo away!", "townsfolk-female/concerned/6.png",
"What was that? This is how horror\ntheatre bits start…", "townsfolk-female/concerned/7.png" ],
"What's that?",
"Did you see that?"
],
"alerted" : [ "alerted" : [
"Eeeek!", "townsfolk-female/alerted/1.png",
"Stay away from me!", "townsfolk-female/alerted/2.png",
"Guards! Guards!", "townsfolk-female/alerted/3.png",
"What in the nine hells?", "townsfolk-female/alerted/4.png",
"Get back or I'll swoon!", "townsfolk-female/alerted/5.png",
"Help! He's after me virtue!" "townsfolk-female/alerted/6.png"
], ],
"losthim" : [ "losthim" : [
"Good riddance! Theres too many\nmale protagonists in\ngames anyhow!", "townsfolk-female/losthim/3.png"
"I sure am glad thats over.",
"This town is going straight to hell.",
"I hope he doesnt come back.",
"I hope hes caught and hanged!"
] ]
}, },
"townsfolk-guard" : { "townsfolk-guard" : {
"unaware" : [ "unaware" : [
"Just doing my civic duty.", "townsfolk-guard/unaware/1.png",
"Good day, citizens.", "townsfolk-guard/unaware/2.png",
"Honor. Liberty. Justice.\nOh, and pancakes…\nI love pancakes.", "townsfolk-guard/unaware/4.png",
"No loitering.", "townsfolk-guard/unaware/5.png",
"I am the law.", "townsfolk-guard/unaware/6.png",
"May Evil beware and may\nGood dress warmly and\neat plenty of fresh vegetables.", "townsfolk-guard/unaware/7.png"
"We're sworn to protect The City."
], ],
"concerned" : [ "concerned" : [
"I sense law-breaking abound.", "townsfolk-guard/concerned/1.png",
"Did you hear something?", "townsfolk-guard/concerned/2.png",
"Did you see that?", "townsfolk-guard/concerned/3.png",
"I know you're around here\nsomewhere, rat…", "townsfolk-guard/concerned/5.png",
"Don't make me look for\nyou in hard-to-reach places!", "townsfolk-guard/concerned/6.png"
"The eyes play tricks\nlike tiny, round devils."
], ],
"alerted" : [ "alerted" : [
"Surrender lawbreaker!", "townsfolk-guard/alerted/1.png",
"Halt!", "townsfolk-guard/alerted/2.png",
"Halt! In the name of the… umm, er… me!", "townsfolk-guard/alerted/4.png",
"Prepare for justice, criminal!", "townsfolk-guard/alerted/5.png",
"I am justice!", "townsfolk-guard/alerted/7.png",
"Theres no escaping the law!", "townsfolk-guard/alerted/8.png",
"Surrender thief!", "townsfolk-guard/alerted/9.png"
"Prepare to taste steel!",
"Clear the area! Nobody\npanic! I'll catch him!"
], ],
"losthim" : [ "losthim" : [
"Ill get you next time,\ncriminal scum.", "townsfolk-guard/losthim/2.png",
"Defeat is a harsh mistress.", "townsfolk-guard/losthim/3.png",
"Evil men may get away, but\njustice fights another day.", "townsfolk-guard/losthim/4.png"
"Wickedness flees, evading the\ncold steel of righteousness."
] ]
} }
}, },
@@ -327,7 +536,8 @@ var AISprite = function(game, x, y, spritetype) {
} }
this.clearWordBubble = function() { this.clearWordBubble = function() {
this.clear_bubble = true; this.bubble.destroy();
this.bubble = null;
this.enable_word_bubble = false; this.enable_word_bubble = false;
timer = game.time.create(false); timer = game.time.create(false);
timerev = timer.add(10000, this.enableWordBubble, this); timerev = timer.add(10000, this.enableWordBubble, this);
@@ -361,9 +571,7 @@ var AISprite = function(game, x, y, spritetype) {
} }
var mylines = moonlightDialog['status'][this.sprite_group][aistate]; var mylines = moonlightDialog['status'][this.sprite_group][aistate];
this.bubble_text = mylines[game.rnd.integerInRange(0, mylines.length)]; this.bubble = game.add.Sprite(this.x, this.y, mylines[game.rnd.integerInRange(0, mylines.length)]);
this.bubble_style = {font: '12px Arial Bold', fill: '#ffffff', align: 'center'}
this.bubble = game.add.text(this.x, this.y - 20, this.bubble_text, this.bubble_style);
timer = game.time.create(false); timer = game.time.create(false);
timerev = timer.add(5000, this.clearWordBubble, this); timerev = timer.add(5000, this.clearWordBubble, this);
@@ -383,17 +591,8 @@ var AISprite = function(game, x, y, spritetype) {
this.setWordBubble(); this.setWordBubble();
} }
if ( this.bubble !== null ) { this.bubble.x = this.x - (this.bubble.width);
this.bubble.destroy(); this.bubble.y = this.y - (this.bubble.height);
if ( this.clear_bubble == true ) {
this.bubble = null;
this.clear_bubble = false;
console.log("Cleared bubble");
} else {
this.bubble = game.add.text(this.x, this.y - 20, this.bubble_text, this.bubble_style);
}
}
switch ( game.rnd.integerInRange(0, 4) ) { switch ( game.rnd.integerInRange(0, 4) ) {
case 0: { case 0: {
setSpriteMovement(this, running, 'up'); setSpriteMovement(this, running, 'up');