Jump to content

Hi, New in Leadwerks and my first learn project.


Santiago3D
 Share

Recommended Posts

 

 

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

Battelship1.JPG

Link to comment
Share on other sites

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.

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...