Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import Bah.FreeImage
- SuperStrict
- Type TState Abstract
- Method Update() Abstract
- Method Render() Abstract
- Method Create() Abstract
- Method Remove() Abstract
- Field EndState:Byte = False
- Method Run()
- Create()
- Local timer:ttimer = CreateTimer(40)
- Repeat
- Update()
- Render()
- Flip 0
- Cls
- WaitTimer timer
- Until AppTerminate() Or EndState
- Remove()
- EndMethod
- EndType
- Type TGameState Extends TState
- Field Objs:TList
- Method Update()
- EndMethod
- Method Render()
- EndMethod
- Method Create()
- Objs = New TList
- EndMethod
- Method Remove()
- For Local Obj:TObject= EachIn Objs
- Obj.Remove
- Next
- Objs = Null
- EndMethod
- EndType
- Type TVector
- Field X:Float, Y:Float
- EndType
- Type TObject 'Ein Objekt
- Field Position:TVector 'Die Position des Objektes
- Field Move:TVector 'Der Bewegungsvektor des Objektes
- Method New()
- Create
- EndMethod
- Method Update() Abstract
- Method render() Abstract
- Method Create()
- EndMethod
- Method Remove()
- EndMethod
- EndType
- Type TGravityObject Extends TObject 'Ein Objekt welches Schwerkraft ausübt
- Field Radius:Float 'Der Radius des Objektes
- EndType
- Type TSolidObject Extends TObject 'Ein Objekt welches Schwerkraft Entgegennimmt
- EndType
- Type TCamera
- Field Width:Int, height:Int
- Field Position:TVector
- Field Objs:TList
- Method Render()
- SetViewport Width,Height
- SetOrigin Position.X, Position.Y
- For Local Obj:TObject= EachIn Objs
- Obj.Render
- Next
- SetOrigin 0,0
- SetViewport 0,0
- EndMethod
- Method Create:TCamera(Width:Int, Height:Int Position:TVector)
- Self.width = width
- Self.height = height
- Self.position = position
- Self.Objs = New TList
- EndMethod
- Method AddRenderObject(Obj:TObject)
- Objs.addLast Obj
- EndMethod
- EndType
- Function LoadMyIMage:TImage(p:String)
- Return LoadImage(CopyPixmap(LoadFreeImage(p).pixmap))
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement