Demo update
-added 'dot' function to vector math -fixed Circle tool rendering -fixed some potentiall memory leaks -added 'collision' module which now separates ShootGrid from SpaceInvaders demo -separate some systems from demos to 'basic' module to better demos functionality sharing -slow down snake -added new graphics -BrickBreaker demo now works (without blocks breaking and with bugged collision detection) -some bug fixes
This commit is contained in:
parent
a0efa4e67d
commit
74179b4fc8
14 changed files with 871 additions and 468 deletions
|
|
@ -235,10 +235,10 @@ struct CMovement
|
|||
Direction direction;
|
||||
}
|
||||
|
||||
struct CInput
|
||||
{
|
||||
mixin ECS.Component;
|
||||
}
|
||||
// struct CInput
|
||||
// {
|
||||
// mixin ECS.Component;
|
||||
// }
|
||||
|
||||
struct AppleSystem
|
||||
{
|
||||
|
|
@ -849,7 +849,7 @@ struct CopyLocationSystem
|
|||
|
||||
__gshared Snake* snake;
|
||||
|
||||
void snakeStart()
|
||||
void snakeRegister()
|
||||
{
|
||||
import game_core.rendering;
|
||||
|
||||
|
|
@ -890,7 +890,10 @@ void snakeStart()
|
|||
launcher.manager.registerSystem!SnakeSystem(101);
|
||||
|
||||
launcher.manager.endRegister();
|
||||
}
|
||||
|
||||
void snakeStart()
|
||||
{
|
||||
launcher.gui_manager.addComponent(CApple(),"Apple");
|
||||
launcher.gui_manager.addComponent(CSnake(),"Snake");
|
||||
launcher.gui_manager.addComponent(CParticle(1000),"Particle");
|
||||
|
|
@ -975,9 +978,9 @@ bool snakeLoop()
|
|||
if(launcher.getKeyState(SDL_SCANCODE_SPACE))time += delta_time * 3;
|
||||
else time += delta_time;
|
||||
|
||||
while(time > 100)
|
||||
while(time > 200)
|
||||
{
|
||||
time -= 100;
|
||||
time -= 200;
|
||||
|
||||
launcher.manager.update("fixed");
|
||||
}
|
||||
|
|
@ -992,6 +995,7 @@ bool snakeLoop()
|
|||
DemoCallbacks getSnakeDemo()
|
||||
{
|
||||
DemoCallbacks demo;
|
||||
demo.register = &snakeRegister;
|
||||
demo.initialize = &snakeStart;
|
||||
demo.deinitialize = &snakeEnd;
|
||||
demo.loop = &snakeLoop;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue