Sort of started working on Title Screen.
This commit is contained in:
parent
736c955f1c
commit
eecc18e330
|
@ -3,29 +3,15 @@ function titleScreen () {
|
|||
OS.SetRoom(rm_TitleScreen);
|
||||
}
|
||||
|
||||
rm_TitleScreen.DoFirst = function () {
|
||||
//Hide cursor when playing (only use if masking the cursor with another object)
|
||||
//OS.canvas.style.cursor = "none";
|
||||
|
||||
// Create objects on room start. This is best practice unless you need persistent objects.
|
||||
Game.player = this.AddObject(OS.P["UFO"]);
|
||||
Game.ball = this.AddObject(OS.P["Ball"]);
|
||||
Game.cowboys = Math.floor(RandomRange(5, 50));
|
||||
for (var i = 0; i < Game.cowboys; i++) {
|
||||
this.AddObject(OS.P["Cowboy"]);
|
||||
}
|
||||
}
|
||||
rm_TitleScreen.Do = function () {
|
||||
if (Game.cowboys <= 0) {
|
||||
OS.SetRoom(rm_TitleScreen);
|
||||
}
|
||||
// Menu options.
|
||||
}
|
||||
rm_TitleScreen.DrawAbove = function () {
|
||||
// Draw the number of cowboys remaining
|
||||
if (Game.ball !== null) {
|
||||
OS.context.font = "18px Impact";
|
||||
OS.context.fillText(Game.cowboys, 15, 30);
|
||||
}
|
||||
rm_TitleScreen.DrawBelow = function () {
|
||||
// Fill background color because I can't figure out how to make OversimplifiedJS change the bg color on room change!
|
||||
var tmp = Oversimplified.context.fillStyle;
|
||||
Oversimplified.context.fillStyle = "#D9BEA5";
|
||||
Oversimplified.context.fillRect(0, 0, Oversimplified.camera.width, Oversimplified.camera.height);
|
||||
Oversimplified.context.fillStyle = tmp;
|
||||
}
|
||||
rm_TitleScreen.DoLast = function () {
|
||||
// Clear Objects on room exit. This is best practice unless you need persistent objects.
|
||||
|
|
Loading…
Reference in New Issue