-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyNewGameApp.cs
64 lines (55 loc) · 1.93 KB
/
MyNewGameApp.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Caravel;
using Caravel.Core;
using Caravel.Core.Physics;
using Caravel.Core.Process;
using Microsoft.Xna.Framework;
namespace MyNewGame
{
public class MyNewGameApp : CaravelApp
{
public MyNewGameApp(int screenWidth, int screenHeight, bool allowWindowResize = false) : base(screenWidth, screenHeight, allowWindowResize)
{
UseDevelopmentDirectories = true;
}
protected override bool VCheckGameSystemResources()
{
return true;
}
protected override Cv_GameLogic VCreateGameLogic()
{
//You can inherit from this class if you want to override some of the methods but most times just the base game logic is fine
return new Cv_GameLogic(this);
}
protected override Cv_GamePhysics VCreateGamePhysics()
{
return new Cv_VelcroPhysics(this);
}
protected override Cv_GameView[] VCreateGameViews()
{
//Create a default player view that occupies the entire screen starting at pos 0,0
var pv = new Cv_PlayerView(Cv_Player.One, Vector2.One, Vector2.Zero);
return new Cv_GameView[] { pv };
}
protected override string VGetGameAppDirectoryName()
{
return "starter_project";
}
protected override string VGetGameTitle()
{
return "MyNewGame";
}
protected override bool VInitialize()
{
//Do any loading and initialization logic here then send the game to load state
Logic.ChangeState(Cv_GameLogic.Cv_GameState.LoadingScene);
return true;
}
protected override bool VLoadGame()
{
//Load our first scene
var loadProcess = new Cv_LoadSceneProcess("testScene.cvs", "Default", "Example Scene");
ProcessManager.AttachProcess(loadProcess);
return true;
}
}
}