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