Santiago3D Posted August 13, 2017 Share Posted August 13, 2017 Hi, on the advice of a friend I am testing leadwerks, so far all my games have been programmed with Blitz3D, but I need to expand my horizons, especially in graphical limitations, so I am learning how to use Leadwerks. I spent all week trying to understand how Leadwerks, Lua, Shaders, CPU / GPU works ... hours and hours of youtube and see the forum, and I make my fist steps in Leadwerks in a simple game. To learn I decided to make a game of a boat, which must defend and attack in a small lake. Until now, achieve: - Import objects from 3dsmax - Assign materials to objects. - Make a script to move the boat - Make a script to rotate the turret - Make a script to change the elevation of the cannon. And when you press SPACE, shoot. I have a thousand questions to ask, but I want to try to discover it on my own. Although some I think it is better to ask them so I already learn to make the code in the correct way. When I press SPACE I create an ammunition, but how do I do it? And how do I check all the ammunition and move them, according to your SCRIPT. And mainly, where should the code go to review all the ammunition in each loop? Greetings, Santiago Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted August 13, 2017 Share Posted August 13, 2017 There is a Projectile script provided with Leadwerks that should do what you want. In the Assets tab - Scripts - Objects - Weapons. Good luck with your game. Quote Link to comment Share on other sites More sharing options...
Santiago3D Posted August 13, 2017 Author Share Posted August 13, 2017 Thanks ! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 14, 2017 Share Posted August 14, 2017 Hi Santiago, First of welcome to the forum and to Leadwerks. As for your question On 8/13/2017 at 4:25 AM, Santiago3D said: When I press SPACE I create an ammunition, but how do I do it? And how do I check all the ammunition and move them, according to your SCRIPT. And mainly, where should the code go to review all the ammunition in each loop? As Thirsy Panther stated, there is a projectile script available that you can use. If you want to try it out on your own start with something like this: --pseudo if key.space then local bulletInstance = bulletPrefab:Instantiate() --You can use prefabs to load an entity that has a script. --if it is just an entity, set the script for this newly created bullet bulletInstance:SetScript("bullet.lua") end I would also recommend making a new topic in the programming section where you can clearly state your question and possibly give some more info like current scene setup, what you have in code so far etc. The more info you provide on what you want, the better we can help you. Quote Link to comment Share on other sites More sharing options...
Santiago3D Posted August 14, 2017 Author Share Posted August 14, 2017 Excelent!, Thanks. now i fire cubes with the correct script. tanks!! Quote 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.