Jump to content

Package System BMAX?


Cole Chapman
 Share

Recommended Posts

Nvm, I got it

 

Framework leadwerks.ENGINE
Import "Framework.BMX"
RegisterAbstractPath( "C:/Leadwerks Engine SDK" ) 
'RegisterAbstractPath("zip::Package.pak")
SetZipStreamPassword("PackagePass.pak", "12345")
GCSetMode(2)
AppTitle:String = "Game Client"


Global FW:TFramework
Local Mesh:TMesh
Local Light:TLight
Local Ground:TMesh
Local Material:TMaterial


Graphics(800,600)


FW:TFramework = CreateFramework()
If Not FW RuntimeError "Failed to create world."

Global Terrain:TTerrain
Local TerrainText:TTexture
Global Move:Float
Global Strafe:Float
Global CamRotation:TVec3 = Vec3(0)
Global mx:Float
Global my:Float
Global MouseXInt:Int
Global MouseYInt:Int

Terrain = CreateTerrain(2048)
LoadTerrainHeightmap(Terrain, "zip::PackagePass.pak//Terrain.raw")
TerrainText = LoadTexture("zip::PackagePass.pak//TerrainGrass.dds")
SetTerrainTexture(Terrain, TerrainText, 0, 0)
PositionEntity(FW.Main.Camera, Vec3(0.0, 280.0, 0.0))
Light:TLight = CreateDirectionalLight()
PositionEntity(Light, Vec3(0.0, 350.0, 0.0))
RotateEntity(Light, Vec3(45,45,0))

CameraRange(FW.Main.Camera, 0.1, 750.0)

'DOF
SetSkyBox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat"))
SetBackGroundColor(Vec4(1,1,1,1))


SetStats(1)
Repeat	
If KeyHit(KEY_ESCAPE) Exit
If AppTerminate() Exit

CameraUpdate()

FW.Update()
FW.Render()


Flip(0)
Forever

GCCollect()
End


Function CameraUpdate()
If KeyDown(KEY_SPACE)
	mx = MouseX() - GraphicsWidth()/2
	my = MouseY() - GraphicsHeight()/2
	MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2)
	CamRotation.X = CamRotation.X + my
	CamRotation.Y = CamRotation.Y - mx
	RotateEntity(FW.Main.Camera, CamRotation)

	move = (KeyDown(KEY_W) - KeyDown(KEY_S)) * 10
	strafe = (KeyDown(KEY_D) - KeyDown(KEY_A)) * 10
	MoveEntity(fw.Main.camera, Vec3(strafe / 10.0, 0, move / 10.0))
EndIf
EndFunction

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...