Skip to content

Commit

Permalink
final polish / music streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cannasse committed Aug 27, 2012
1 parent efffe4a commit a2626a8
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 26 deletions.
4 changes: 2 additions & 2 deletions TIME.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Day 2

~1h30 between 19:00 and 00:30 : sounds

00:30-02:00 : music and final polish
00:30-02:30 : music and final polish

TOTAL TIME = 24 hours
TOTAL TIME = 24.5 hours
Binary file modified gfx/dungeon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gfx/world.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions ld24.hxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
</compileTargets>
<!-- Assets to embed into the output SWF -->
<library>
<asset path="gfx\04B_03__.TTF" id="BmpFont" glyphs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ?!,()-/" />
<asset path="sfx\music1.mp3" id="Music1" />
<asset path="gfx\04B_03__.TTF" id="BmpFont" glyphs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ?!,()-/'" />
</library>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
Expand Down
Binary file modified ld24.swf
Binary file not shown.
File renamed without changes.
3 changes: 1 addition & 2 deletions obj/ld24Library.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<frame>
<library>
<clip id="Sharepoint__" />
<font id="BmpFont" name="BmpFont" import="gfx\04B_03__.TTF" glyphs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ?!,()-/" size="19492" modified="26/08/2012 07:41:16" />
<sound id="Music1" name="Music1" import="sfx\music1.mp3" size="500352" modified="26/08/2012 23:10:58" />
<font id="BmpFont" name="BmpFont" import="gfx\04B_03__.TTF" glyphs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ?!,()-/'" size="19492" modified="26/08/2012 07:41:16" />
</library>
</frame>
</movie>
Binary file modified obj/ld24Resources.swf
Binary file not shown.
16 changes: 6 additions & 10 deletions src/Game.hx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Common;

class Music1 extends flash.media.Sound {
}

class Game implements haxe.Public {

var root : SPR;
Expand All @@ -29,9 +26,10 @@ class Game implements haxe.Public {

var uiBar : SPR;

var music : flash.media.Sound;

var circleSize : Float;
var mask : SPR;
var music : Music1;

static var has = {
monsters : false,
Expand Down Expand Up @@ -89,7 +87,7 @@ class Game implements haxe.Public {

function init() {

music = new Music1();
music = new flash.media.Sound(new flash.net.URLRequest("music1.mp3"));

monsters = [];
entities = [];
Expand Down Expand Up @@ -240,8 +238,9 @@ class Game implements haxe.Public {
flash.external.ExternalInterface.call("eval", s);
}

function popup( text : String, subText : String = "" ) {
function popup( text : String, subText : String = "", dialog = false ) {
var mc = new Popup();
mc.dialog = dialog;
mc.addChild(makePanel(text, subText));
mc.y = output.height;
mc.targetY = output.height - mc.height;
Expand Down Expand Up @@ -377,10 +376,7 @@ class Game implements haxe.Public {
case CFarming:
// no
case CExit:
haxe.Timer.delay(function() {
hero.teleport(60, 42);
initDungeon(false);
},3000);
// nothing
case CPrincess:
win();
case CPorn:
Expand Down
27 changes: 21 additions & 6 deletions src/Hero.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,41 @@ class Hero extends Entity {
}

function talk(n: { x:Int, y:Int } ) {
if( Popup.has() )
if( Popup.hasDialog() )
return;
var p = Game.props;
switch( n.x + "/" + n.y ) {
case "51/64":
case "51/62":
Sounds.play("npc");
if( p.npc == 1 ) {
game.popup("Sorry I have nothing to say to you !", "that's what you get when talking to strangers");
game.popup("Sorry I have nothing to say to you !", "that's what you get when talking to strangers",true);
return;
}
if( p.quests[0] == 0 || (p.quests[0] == 1 && p.gold == 0) ) {
game.popup("You want a <font color='#4040FF'>Quest</font> ?", "Bring me something shiny and I'll will help you");
game.popup("You want a <font color='#4040FF'>Quest</font> ?", "Bring me something shiny and I'll will help you",true);
p.quests[0] = 1;
return;
}
if( p.quests[0] == 1 ) {
p.gold--;
p.quests[0] = 2;
}
game.popup("Thank you for your <font color='#4040FF'>gold coin</font> !", "You can now open doors with keys !");
game.popup("Thank you for your <font color='#4040FF'>gold coin</font> !", "You can now open doors with keys !",true);
case "59/31":
if( p.quests[1] == 0 ) {
p.quests[1] = 1;
Sounds.play("princess");
game.getChest(CPrincess, 0, 0);
}
case "53/47":
Sounds.play("npc");
game.popup("I love fishing", "What about you ?", true);
case "38/61":
Sounds.play("npc");
game.popup("Check our company website <font color='#4040FF'>ShiroGames.com</font>", "What ? In-game advertising ? No way !", true);
case "57/38":
Sounds.play("npc");
game.popup("If you talk to the princess, that will be game ending", "I am married as well, I know what I'm talking about !", true);
default:
trace("Unknown NPC @" + [n.x, n.y]);
}
Expand Down Expand Up @@ -179,7 +188,13 @@ class Hero extends Entity {
cleanPuzzle();
game.getChest(CPuzzle, 0, 0);
}

case DungeonExit:
if( y > 24.9 ) {
teleport(59, 43);
game.initDungeon(false);
game.world.remove(59, 44);
} else
iy = 24;
default:
cleanPuzzle();

Expand Down
8 changes: 6 additions & 2 deletions src/Popup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Popup extends SPR {
public var startY : Float;
public var speed : Float;
public var wait : Float;
public var dialog : Bool;

static var all = new Array<Popup>();

Expand Down Expand Up @@ -38,8 +39,11 @@ class Popup extends SPR {
return true;
}

public static function has() {
return all.length > 0;
public static function hasDialog() {
for( p in all )
if( p.dialog )
return true;
return false;
}

public static function updateAll( dt ) {
Expand Down
9 changes: 7 additions & 2 deletions src/World.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum Block {
DungeonPuzzle;
MonsterGenerator;
FakeTree;
DungeonExit;
// extra
DarkDungeon;
Lock;
Expand Down Expand Up @@ -105,7 +106,7 @@ class World {
case Dark, Tree, Water, Bush, Rock, Cactus, Lock, Door, DarkDungeon, DungeonWall, DungeonStat: true;
case BridgeUD, BridgeLR, Dungeon, MonsterGenerator: false;
case Field, SavePoint, Sand, Free, DungeonSoil, FakeTree: false;
case SandBank, RiverBank, Detail, SandDetail, DungeonStairs, DungeonFakeWall, DungeonFakeDark, DungeonPuzzle : false;
case SandBank, RiverBank, Detail, SandDetail, DungeonStairs, DungeonFakeWall, DungeonFakeDark, DungeonPuzzle, DungeonExit: false;
}
}

Expand All @@ -131,7 +132,7 @@ class World {
if( rec ) null else Water;
case Field, Sand, DungeonSoil:
b;
case DungeonWall,DungeonStat,DungeonStairs,DungeonFakeWall,DungeonPuzzle,MonsterGenerator:
case DungeonWall,DungeonStat,DungeonStairs,DungeonFakeWall,DungeonPuzzle,MonsterGenerator, DungeonExit:
DungeonSoil;
case Detail, RiverBank, SandBank, SandDetail:
null;
Expand Down Expand Up @@ -218,6 +219,8 @@ class World {
case Dark:
if( rnd.random(3) == 0 )
putBlock(x, y, Tree, rnd.random(5) - 2, rnd.random(2), 0, true);
case DungeonExit:
putBlock(x, y, DungeonStairs);
case BridgeLR, BridgeUD, SavePoint, Door, Dungeon, DungeonStat,DungeonStairs, DungeonWall, DungeonFakeWall,DungeonPuzzle,MonsterGenerator,FakeTree:
putBlock(x, y, b);
default:
Expand Down Expand Up @@ -321,6 +324,8 @@ class World {
return MonsterGenerator;
case 0x0F4D01:
return FakeTree;
case 0x9ABC9C:
return DungeonExit;
default:
if( col & 0xFFFF00 == 0xFFFF00 ) {
chests.push( { x:x, y:y, e : null, id : Type.createEnumIndex(Chests.ChestKind,col & 0xFF) } );
Expand Down

0 comments on commit a2626a8

Please sign in to comment.