« Previous entry | Next entry » Browse > Bad code

Skip to comments (4) main module
Posted by Futaba on Jun 22 2009 @ 22:19  :: 663 unique visits

unit Main;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, GLScene, GLObjects, GLCoordinates, GLWin32Viewer,
 GLCrossPlatform, BaseClasses, GLKeyboard, GLCadencer, GLNavigator, GLSmoothNavigator,
 StdCtrls, ExtCtrls, inifiles, GameClasses, LuaEngine;
type
 TForm1 = class(TForm)
   GLScene1: TGLScene;
   GLSceneViewer1: TGLSceneViewer;
   GLCamera1: TGLCamera;
   GLLightSource1: TGLLightSource;
   Ship: TGLCube;
   GLCube2: TGLCube;
   GLCadencer1: TGLCadencer;
   GLCube3: TGLCube;
   Button1: TButton;
   starsPlane: TGLPlane;
   GLSmoothNavigator1: TGLSmoothNavigator;
   Timer1: TTimer;
   log: TMemo;
   Button2: TButton;
   procedure Button1Click(Sender: TObject);
   procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
     newTime: Double);
   procedure Timer1Timer(Sender: TObject);
   procedure Button2Click(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;


var
 Form1: TForm1;
 WorldIni: TIniFile;
 Test1: TGStar;
 LuaEngine_1: TGLuaEngine;
 TestPl: TGPlayer;
implementation

{$R *.dfm}
//game class TRASH

procedure TForm1.Button1Click(Sender: TObject);
var
x,y: integer;
dust: TGLPlane;

begin
//Fill the space
starsPlane.Material.Texture.Image.LoadFromFile('textures\stars.bmp');
starsPlane.Material.Texture.Disabled:=False;
WorldIni:=Tinifile.Create(ExtractFilePath(Application.ExeName)+'config\main.cfg');


//Lua Engine start
 try
   LuaEngine_1:=TGLuaEngine.Create(GLScene1);
   LuaEngine_1.PushScene(GLScene1);
   log.Lines.Add('Lua engine started');
 except
   //
   log.Lines.Add('error: Lua isnt started');
 end;
//DEBUG
Test1:=TGStar(GLScene1.Objects.AddNewChild(TGStar));
//if not (Test1.Init(GLScene1.Objects)=False) then log.Lines.Add('Test1 is added') else
 //                                  log.Lines.Add('error: Test1 isnt added') ;

TestPl:=TGPlayer.Create(GLScene1);
if not (TestPL.Init(GLScene1.Objects)=False) then log.Lines.Add('TestPL is added') else
                                   log.Lines.Add('error: TestPL isnt added') ;
GLCadencer1.Enabled:=true;
end;

procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
 newTime: Double);
 var
 tag1,tag2,tag3: integer;
begin
// Player input
TestPl.HandleInput(deltaTime);
TestPl.progress(GLCadencer1,GLCamera1);
GLCamera1.TargetObject:=TestPl;
GLSceneViewer1.Invalidate;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
GLSceneViewer1.Invalidate;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if not (LuaEngine_1.luaExec('Lua/test.lua')=true) then log.Lines.Add('error: Lua script invalid')
                                           else log.Lines.Add('Lua script executed');
end;

end.

4 comments posted so far
Add your own »

1. On Jul 01 2009 @ 10:38 guest wrote:

Thousands of Ed Hardy Clothing:Ed Hardy T-shirts, swimwear, Ed Hardy Walletstanks, Ed Hardy Mens T-Shirts, belts sunglasses and
Ed Hardy Womens Swimwear. Hot design and newest
Ed Hardy Womens T-Shirtsat unbelievable prices. Charmed by the magic of amazing tattoo and Ed Hardy Womens Tanks. Free shipping and excellent customer service. Break the rules, create your own life style here in tiffany jewellery  !
Paul Smith uk store,See discount Paul Smith large range of online,We have
Paul Smith Shoes and Paul Smith sale in all styles.

2. On Jul 14 2009 @ 03:59 guest wrote:

buy wow gold
my wow power leveling
buy wow gold
good wow power leveling
BUY wow gold
my wow power leveling
CHEAP rs gold
cheap wow power leveling
CHEAPEST lotro gold
MY aion gold
buy wow gold
cheap wow gold
CHEAPEST wow gold

4. On Jan 05 2010 @ 15:23 uggbaileybutton wrote:

bailey button uggs

-ugg boots cheap

ugg boots uk

ugg classic

Add a new comment

Name:
Password: (leave empty for anonymous comment)
 
View formatting tags Comment: