scaling, but weirdly positioned hollywoo-flixel props
This commit is contained in:
@@ -9,9 +9,9 @@ enum Appearance {
|
||||
|
||||
typedef Continuation = Void -> Void;
|
||||
|
||||
interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song> {
|
||||
var movie(default, default):Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song>;
|
||||
function showScene(scene:Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor>, appearance:Appearance, cc:Continuation):Void;
|
||||
interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song, Prop> {
|
||||
var movie(default, default):Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song, Prop>;
|
||||
function showScene(scene:Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>, appearance:Appearance, cc:Continuation):Void;
|
||||
function showCharacter(character:Character<StagePosition, StageFacing, Actor>, appearance:Appearance, cc:Continuation):Void;
|
||||
function playSound(sound:Sound, volumeMod:Float, waitForEnd:Bool, cc:Continuation):Void;
|
||||
function playSong(song:Song, volumeMod:Float, loop:Bool, waitForEnd:Bool, cc:Continuation):Void;
|
||||
@@ -19,4 +19,7 @@ interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound
|
||||
function startWaitForInput(cc:Continuation):Void;
|
||||
function stopWaitForInput():Void;
|
||||
function showDialog(speakerName:String, type:SpeechType<StagePosition, StageFacing, Actor>, wryly:String, dialog:String, cc:Continuation):Void;
|
||||
function showPropOnScreen(prop:Prop, position:ScreenPosition, cc:Continuation):Void;
|
||||
// TODO showPropOnStage
|
||||
function hideProp(prop:Prop, cc:Continuation):Void;
|
||||
}
|
||||
|
@@ -17,8 +17,8 @@ enum DelayHandling {
|
||||
* Model/controller of a Hollywoo film, and main execution script
|
||||
*/
|
||||
@:build(kiss.Kiss.build())
|
||||
class Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song> extends AsyncEmbeddedScript {
|
||||
class Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song, Prop> extends AsyncEmbeddedScript {
|
||||
// TODO for some reason this wasn't working when declared in Movie.kiss:
|
||||
// Mutable representation of frames in time:
|
||||
var scenes:Map<String, Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor>> = [];
|
||||
var scenes:Map<String, Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>> = [];
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
(prop :Map<String,Actor> actors (new Map))
|
||||
(prop :Map<String,Sound> sounds (new Map))
|
||||
(prop :Map<String,Song> songs (new Map))
|
||||
(prop :Map<String,Prop> props (new Map))
|
||||
|
||||
(prop &mut :DelayHandling delayHandling AutoWithSkip)
|
||||
|
||||
@@ -29,7 +30,7 @@
|
||||
(defNew
|
||||
[
|
||||
// "View" in the Model-View-Controller architecture:
|
||||
&prop :Director<Set,StagePosition,StageFacing,ScreenPosition,Actor,Sound,Song> director
|
||||
&prop :Director<Set,StagePosition,StageFacing,ScreenPosition,Actor,Sound,Song,Prop> director
|
||||
]
|
||||
|
||||
(set director.movie this)
|
||||
@@ -73,11 +74,13 @@
|
||||
(dictGet sets setKey)
|
||||
characters
|
||||
(new Map)
|
||||
propsOnScreen
|
||||
(new Map)
|
||||
]
|
||||
time
|
||||
perspective)))
|
||||
|
||||
(method newScene [name :Scene<Set,StagePosition,StageFacing,ScreenPosition,Actor> scene]
|
||||
(method newScene [name :Scene<Set,StagePosition,StageFacing,ScreenPosition,Actor,Prop> scene]
|
||||
(assert isLoading)
|
||||
(dictSet scenes name scene))
|
||||
|
||||
@@ -140,6 +143,19 @@
|
||||
// TODO moveCharacter remove them, add them to another scene
|
||||
// TODO moveCharacterAndFollow remove them, add them to another scene, set that the scene
|
||||
|
||||
(method newProp [name :Prop prop]
|
||||
(assert isLoading)
|
||||
(dictSet props name prop))
|
||||
|
||||
(method addPropToScreen [name :ScreenPosition position :Continuation cc]
|
||||
(dictSet .propsOnScreen (_currentScene) name (dictGet props name))
|
||||
(director.showPropOnScreen (dictGet props name) position cc))
|
||||
|
||||
(method removePropFromScrene [name :Continuation cc]
|
||||
(director.hideProp (dictGet props name) cc))
|
||||
|
||||
// TODO removeProp
|
||||
|
||||
// Dialogue:
|
||||
|
||||
(method superText [text cc]
|
||||
|
@@ -28,9 +28,11 @@ enum SpeechType<StagePosition, StageFacing, Actor> {
|
||||
Custom(type:String, actor:Actor, args:Dynamic);
|
||||
}
|
||||
|
||||
typedef Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor> = {
|
||||
typedef Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop> = {
|
||||
set:Set,
|
||||
characters:Map<String, Character<StagePosition, StageFacing, Actor>>,
|
||||
propsOnScreen:Map<String, Prop>,
|
||||
// TODO props on stage
|
||||
time:SceneTime,
|
||||
perspective:ScenePerspective
|
||||
};
|
||||
|
Reference in New Issue
Block a user