YouGroove Posted March 4, 2013 Share Posted March 4, 2013 Yes some non programmers like me we would like to see some good templates of code fo standard gameplay stuff, coded in the simpliest way possible, easy to learn. It's just a whish Lits and reminder about we would want to see as gameplay and code. So anyone can add what he would need in terms of code template. - Real 3rd camera script - Character player motion non FPS view : direction controlled by mouse , forward and backward by keys. - gun and bullet code : shoot, and raycast collision - rocket launcher code : shoot, movement or rocket , collision on entities or obstacles - FPS camera driven by mouse and keys for (wlak forward , backward and strafe. - Physic monkey ball game style control driven by mouse or keys Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 5, 2013 Share Posted March 5, 2013 I created a slimmed down version of a camera script, it doesn't do any fancy raycasting but I feel is fairly readable. Script.target = nil--Entity "Target" Script.distance = 10--float Script.debugphysics = false--bool Script.debugnavigation = false--bool Script.pitch = 20--float Script.height = 10--float function Script:Start() if self.target==nil then return end --debug functions for viewing physics or navigation in game self.entity:SetDebugPhysicsMode(self.debugphysics) self.entity:SetDebugNavigationMode(self.debugnavigation) --Set the cameras rotation self.entity:SetRotation(self.pitch,0,0) end function Script:UpdatePhysics() --Exit the function if the target entity does not exist if self.target==nil then return end --Get the target entitys position, in global coordinates local p0 = self.target:GetPosition(true) --Calculate the new camera offset local offset = Vec3(p0.x,p0.y+self.height,p0.z-self.distance) --Add our original offset vector to the target entity position p0 = offset self.entity:SetPosition(p0,true) end Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 5, 2013 Author Share Posted March 5, 2013 Thanks a lot Chris I'm not good at maths vectors so i didn't how to manage the camera when it's not a simple travelling one. I tested the code on a character that goes to a point with navmesh. I put the character on target slot fo camera, the camera follow it, but never turns ? It's another travelling camera Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted March 5, 2013 Author Share Posted March 5, 2013 Other stuff needed : The game demo is full of code , state machines, animations, all that in ONE file : not clear , confusing. Why not having : All animation in one Lua file called by messages on GoblinAI ? processAnimation("WALK"); one line to call another LUA Class Same for states AI, they make things confusing. **************** In fact it would be great to find a simple script to just move a cube in all directions. - by keys use as actual game - by using mouse direction and keys. The SHORTEST simple code possible (no animations, no camera) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted March 6, 2013 Author Share Posted March 6, 2013 FPS Camera and walk ? The guy that made the sweet vide of LE3 FPS , would he give us some code gracefully Quote Stop toying and make games Link to comment Share on other sites More sharing options...
cassius Posted March 6, 2013 Share Posted March 6, 2013 +1 Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
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.