36 lines
No EOL
1.4 KiB
C#
36 lines
No EOL
1.4 KiB
C#
using System;
|
|
using Microsoft.Xna.Framework;
|
|
using Nez;
|
|
|
|
namespace Inky
|
|
{
|
|
public class InkyScene : Scene
|
|
{
|
|
public InkyScene()
|
|
{
|
|
// set up screen & camera
|
|
SetDesignResolution(1280, 720, SceneResolutionPolicy.ShowAllPixelPerfect);
|
|
Screen.SetSize(1280, 720);
|
|
ClearColor = Color.White;
|
|
// render background, then everything else, then UI layers
|
|
AddRenderer(new ScreenSpaceRenderer(0, GameConstants.BackgroundRenderLayer));
|
|
AddRenderer(new RenderLayerExcludeRenderer(10, GameConstants.UiRenderLayerBg,
|
|
GameConstants.BackgroundRenderLayer, GameConstants.UiRenderLayerFg));
|
|
AddRenderer(new ScreenSpaceRenderer(100, GameConstants.UiRenderLayerBg, GameConstants.UiRenderLayerFg));
|
|
Core.ExitOnEscapeKeypress = false;
|
|
if (Environment.GetEnvironmentVariable("DEBUG_RENDERING") != null)
|
|
Core.DebugRenderEnabled = true;
|
|
|
|
var inky1 = CreateEntity("inky");
|
|
inky1.AddComponent<Lanky>().Color = Color.Black;
|
|
inky1.Position = new Vector2(300, 300);
|
|
|
|
var worm = CreateEntity("worm");
|
|
//worm.AddComponent<Skeletron.Skeletron>().Color = Color.Black;
|
|
worm.AddComponent<Lanky2>();
|
|
worm.Position = new Vector2(600, 400);
|
|
|
|
AddSceneComponent<DemoControls>();
|
|
}
|
|
}
|
|
} |