-
Posts
183 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by codeape
-
-
This could possibly be of help:
-
shadmar, you are awesome!
-
Cool, I might have use for it ... so thanks ...
-
I got it to work now =)
function Script:Start() --Player movement speed self.moveSpeed = 0.2 -- Camera distance from player self.camDist = 10 -- Create camera and position it local camPos = self.entity:GetPosition(true) self.cam = Camera:Create() camPos.y = self.camDist self.cam:Move(camPos) self.cam:SetRotation(90,0,0) end function Script:UpdatePhysics() local window = Window:GetCurrent() local context = Context:GetCurrent() -- Player keyboard input local xMod = 0; if window:KeyDown(Key.D) then xMod = 1 * Time:GetSpeed() * self.moveSpeed elseif window:KeyDown(Key.A) then xMod = -1 * Time:GetSpeed() * self.moveSpeed end local zMod = 0 if window:KeyDown(Key.W) then zMod = 1 * Time:GetSpeed() * self.moveSpeed elseif window:KeyDown(Key.S) then zMod = -1 * Time:GetSpeed() * self.moveSpeed end -- Move player local curr = self.entity:GetPosition(true) curr.x = curr.x + xMod curr.z = curr.z + zMod self.entity:SetPosition(curr, true) -- Move camera curr.y = self.camDist self.cam:SetPosition(curr, true) end
I did some other changes. Like not creating my player Entity (a box) in code (for now). And I changed the physics mode to "Character Controller" (the Collition type is "Character" also but I do not think that maters for the problems I had).
I also moved all code from App.lua to it's own script that is attached to the player Entity.
-
Thanks Shadmar!
-
Ok, added this to App.lua
function App:UpdatePhysics() System:Print("Hook 1") local curr = self.cone:GetPosition(true) curr.y = self.camDist self.cam:SetPosition(curr, true) end
According to the Scripts reference: "This function will be called once per physics step."
http://www.leadwerks.com/werkspace/page/documentation/_/script-reference/
However it looks like it is never called. What am I missing?
-
Ahhha I probably need to do my things in Entity::UpdatePhysicsHook and Entity::UpdateHook() to get things smooth:
How do I set a Hook on a Entity?
-
Thanks Aggror and cassius
Tried PhysicsSetPosition() and added physics type Entity.RigidBodyPhysics and mass 1. Now it works but the movement is not very smoth like when I used SetPosition. I need to trim this
-
Hello
I like Leadwerks ... and have a lot fun with it ... however
I am playing around with the Steam Leadwerks (Lua) and try to make a simple "top down shooter". I have watched some tutorials and I thought I did this right.
I create my player (currently a cone) like this:
--Player self.coneMat = Material:Load("Materials/Developer/greengrid.mat") self.cone = Model:Cone() self.cone:SetMaterial(self.coneMat) self.cone:SetPosition(0,1.75,0) self.cone:SetRotation(90,0,0) local shape = Shape:Cone(0,0,0, 0,0,0, 1,1,1) self.cone:SetShape(shape) --Player movement speed self.moveSpeed = 0.1
I have created a floor and 4 walls in the editor and the walls have "Physics mode : Rigid Body" and a shape size that corresponds to the wall size (used the "Fit Shape" button in the Physics tab).
The player movement code looks like this:
-- Player movement local xMod = 0; if self.window:KeyDown(Key.D) then xMod = 1 * Time:GetSpeed() * self.moveSpeed elseif self.window:KeyDown(Key.A) then xMod = -1 * Time:GetSpeed() * self.moveSpeed end local zMod = 0 if self.window:KeyDown(Key.W) then zMod = 1 * Time:GetSpeed() * self.moveSpeed elseif self.window:KeyDown(Key.S) then zMod = -1 * Time:GetSpeed() * self.moveSpeed end local curr = self.cone:GetPosition(true) curr.x = curr.x + xMod curr.z = curr.z + zMod self.cone:SetPosition(curr, true) curr = self.cam:GetPosition(true) curr.x = curr.x + xMod curr.z = curr.z + zMod self.cam:SetPosition(curr, true)
The cone go through the walls. What am I doing wrong?
-
I see your now listed as a "backer" rather than member - how did you swing that?
(also a "pro" level KS backer)
I would like to know also.
As I remembered, I registered with the same email that I use on KS and mailed admin that I am a backer.
- 1
-
Now when the steam release is done, as a KS Pro level backer will I be able to see the rest of the forum soon?
- 1
-
Haha INSTALLING!!!!!
-
-
I just bought a Nexus 7 and I want to test it out. Are there any Leadwerks based games you know of on Google play that you can recommend?
Thank you
-
Thank you, but the big challenge is to use the standard system icons when possible, and use icons designed to fit the same theme when there is not a standard system icon for the item. I mean, I doubt Ubuntu has a standard "rotate the selected object around the Y axis" icon.
Ahhhha ok
-
Hello
Here Josh, are the amount of 3800 icons sizes are 32x32 and 16x16:
http://www.fatcow.com/free-icons
These icons are licensed under a Creative Commons Attribution 3.0 License.
Have fun =)
-
-
NVIDIA Is "Taking Linux Gaming Serious":
http://www.phoronix.com/scan.php?page=news_item&px=MTUyNjE
For example, with the latest Linux vs. Windows NVIDIA comparison, the $1000 USD Titan was running at effectively the same speed between operating systems.
Maybe I will go for a Nvidia card this time.
-
The exact numbers will depend on your hardware, but it's very efficient at rendering instanced geometry like that. 10,000 on camera might be too many, but with distance and frustum culling that could definitely be done.
Cool, that was exactly the answer I was looking for
-
Hello
Grate update
Reading the update got me very exited. Could the mentioned "uniform buffers for hardware skinning and instanced rendering" be used to create huge astroid fields consisting of for example 10000 or more asteroids using 10 different models with almost no performance penalties. Am I right?
-
Indeed. The thing is that ID make the game engine public domain but never any art assets. Glitch is released with everything.
-
I found this at SlashDot:
Glitch, a collaborative, web-based, massively multiplayer game developed by Tiny Speck, Inc. (tinyspeck.com) has been released under the Creative Commons CC0 1.0 Universal License. I'm not at all familiar with this game, but it is rare that both source code and all game assets are released into the public domain, which makes this announcement noteworthy. An excerpt from the announcement: 'The entire library of art assets from the game has been made freely available, dedicated to the public domain. Code from the game client is included to help developers work with the assets. All of it can be downloaded and used by anyone, for any purpose. (But: use it for good.)Ok it is a 2D game but there must be stuff that can be reused in this package of 10.000+ assets like sounds and music etc.
-
-
I have been a linux user/developer since 1998 and must say that I've never had an issue with either nvidia or amd on linux.
How to develop with Leadwerks and more then one person?
in General Discussion
Posted
Learn git or subversion. They are way more flexible and you get to keep the history of what you do and you will also get conflict handling etc.