33 lines
573 B
C
33 lines
573 B
C
// Copyright © 2017 Project Golan, all rights reserved.
|
|
#include "g_object.h"
|
|
|
|
#include <Doominati.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
// Extern Functions ----------------------------------------------------------|
|
|
|
|
//
|
|
// G_Player_Think
|
|
//
|
|
DGE_Callback
|
|
void G_Player_Think(DGE_Entity ent)
|
|
{
|
|
DGE_Object_RefAdd(ent.id);
|
|
|
|
for(;;)
|
|
{
|
|
if(ent.health <= 0)
|
|
break;
|
|
|
|
ent.vx = ent.vx + (fixed)DGE_GetInputAxis(0, DGE_Axis_X);
|
|
ent.vy = ent.vy - (fixed)DGE_GetInputAxis(0, DGE_Axis_Y);
|
|
|
|
DGE_Task_Sleep(0, 1);
|
|
}
|
|
|
|
DGE_Object_RefSub(ent.id);
|
|
}
|
|
|
|
// EOF
|