unit platformenemy; {$mode objfpc}{$H+} //target practive object interface uses Classes, SysUtils, gl,glext,glu, gameobject, renderobject, graphics, healthbar, globals; type TPlatformEnemy=class(TGameObject) //tutorial step 1. Targets have their own health (so not a TGameObjectWithHealth) private instances: integer; static; ftexture: integer; static; fwidth: single; static; fheight: single; static; protected function getWidth:single; override; function getHeight:single; override; function getTexture: integer; override; public minx,maxx: single; speed: single; procedure travel(time:single); constructor create; destructor destroy; override; end; implementation procedure TPlatformEnemy.travel(time:single); var distance: single; begin distance:=speed*time; x:=x+distance; if x>maxx then begin //don't bother with the overlap, this way it's easier for the player speed:=-speed; x:=maxx; end; if x