A Smoll game engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 line
865 B

8 月之前
8 月之前
8 月之前
8 月之前
8 月之前
  1. using Raylib_cs;
  2. using Smoll;
  3. using Smoll.Ex1;
  4. Layer layer = new Layer();
  5. var entity = new Entity(layer);
  6. entity.Attach(new Transform2DComponent(128, 128, 0));
  7. entity.Attach(new RectangleGizmoComponent(128, 64, Color.Blue));
  8. entity.Attach(new ExampleInputComponent(100f, 0.25f));
  9. entity.Attach(new CrosshairGizmoComponent());
  10. var entity2 = new Entity(entity);
  11. entity2.Attach(new Transform2DComponent(128, 128, 0));
  12. entity2.Attach(new RectangleGizmoComponent(64, 64, Color.Red));
  13. entity2.Attach(new CrosshairGizmoComponent());
  14. Engine engine = new Engine();
  15. engine.layers.Add(layer);
  16. Raylib.InitWindow(800, 600, "Smoll");
  17. while(!Raylib.WindowShouldClose()) {
  18. engine.Update();
  19. Raylib.BeginDrawing();
  20. Raylib.ClearBackground(Color.White);
  21. engine.Draw();
  22. Raylib.DrawFPS(0,0);
  23. Raylib.EndDrawing();
  24. GC.Collect(0);
  25. }
  26. Raylib.CloseWindow();