Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit dd89c9d

Browse files
author
Alexis Huvier
committed
update(demo): Try new features
1 parent abff0e8 commit dd89c9d

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

Demos/SE_BasicGame/MyScene.cs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
using SharpEngine;
2+
using SharpEngine.Component;
3+
using SharpEngine.Entity;
4+
using SharpEngine.Manager;
25
using SharpEngine.Math;
3-
using SharpEngine.Widget;
6+
using SharpEngine.Utils;
7+
using SharpEngine.Utils.Input;
8+
using tainicom.Aether.Physics2D.Dynamics;
49

510
namespace SE_BasicWindow;
611

712
internal class MyScene : Scene
813
{
914
public MyScene()
1015
{
11-
var scrollFrame = AddWidget(new ScrollFrame(new Vec2(300), new Vec2(200)));
16+
var e1 = new Entity();
17+
e1.AddComponent(new TransformComponent(new Vec2(100)));
18+
e1.AddComponent(new RectComponent(Color.Blue, new Vec2(50)));
19+
e1.AddComponent(new PhysicsComponent(ignoreGravity: true, fixedRotation: true)).AddRectangleCollision(new Vec2(50));
20+
e1.AddComponent(new ControlComponent());
21+
AddEntity(e1);
22+
23+
var e2 = new Entity();
24+
e2.AddComponent(new TransformComponent(new Vec2(200)));
25+
e2.AddComponent(new RectComponent(Color.Red, new Vec2(50)));
26+
e2.AddComponent(new PhysicsComponent(BodyType.Static, ignoreGravity: true, fixedRotation: true)).AddRectangleCollision(new Vec2(50));
27+
AddEntity(e2);
28+
}
29+
30+
public override void Update(float delta)
31+
{
32+
base.Update(delta);
1233

13-
for (int i = 0; i < 500; i += 50)
14-
scrollFrame.AddChild(new Label(new Vec2(0, i), $"Test {i}", "basic"));
34+
Window!.CameraManager.Rotation += 10 * delta;
1535
}
1636
}

Demos/SE_BasicGame/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private static void Main()
1313
{
1414
RenderImGui = win =>
1515
{
16-
DebugManager.CreateSeImGuiWindow();
16+
DebugManager.CreateSeImGuiWindow(win);
1717
ImGui.Begin("Basic Game Debug");
1818
if(ImGui.Button("Stop Window"))
1919
win.Stop();

0 commit comments

Comments
 (0)