Jump to content

c++ classes in codeblocks


cassius
 Share

Recommended Posts

I got codeblocks up and running last night and see that there is a class wizard somewhere but I can't find it. Can anyone help?

 

If not can someone give me a class decleration example ? maybe a class called actor.

I am brushing up on c++ in case I need it for le3.Havn't used it for over 8 years.

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

There really isn't anything LE specific about classes. LE 2 isn't object oriented so it's not as if you are deriving from anything. The person would just have member variables that are LE types that they would want to put into the class. That could be done a million different ways.

 

 

I don't think this will help much but:

 

class Actor
{
private:
TModel _model;
string _name;
int _hp;
public:
virtual void Update()=0;
};

 

I don't have the ctor there, but trying to show you that the class itself isn't related to LE at all. The members inside of it can be LE data types but how you do it is completely up to the individual.

Link to comment
Share on other sites

  1. To use the classwizard or LeBuilder as its called now, find it LeBuilder.exe in your SDK folder and start that program.
  2. You will see some different project options, but no CodeBlocks.
  3. Now go HERE and download the template for CodeBlocks.
  4. Once downloaded select Import Template/From Package and select the downloaded zip file.
  5. Now will have an option for building CodeBlocks C++ projects.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Hey Roland is there some doc around how to create a template? I love LEBuilder and would love to make my own template that is more object oriented and more of a game template with classes like Actor, Animation, etc to share. Would that be possible with your LEBuilder program to do? I feel like some people might enjoy having a game template setup for them.

Link to comment
Share on other sites

Right click on the project and choose "Add Class", it will do everything for you.

 

Except of course, write your game for you...

 

 

Thanks both. That class example looks much like types in Bmax exept for public and private.

 

...and protected. When (or if) you start creating sub-classes, anything marked as private is not usable by the new subclass, whereas protected is usable by the subclass (and obviously public is usable by all)

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Hey Roland is there some doc around how to create a template? I love LEBuilder and would love to make my own template that is more object oriented and more of a game template with classes like Actor, Animation, etc to share. Would that be possible with your LEBuilder program to do? I feel like some people might enjoy having a game template setup for them.

 

Here you are :)

 

 

Make your own templates for LEBuilder

 

 

 

I already used le builder. I have got the spinning cube and the ball game running fine. just needed to find the class wizard plugin.

Oh.. sorry. My fault. The project built does not help you with classes, how silly of me. unsure.png

Roland Strålberg
Website: https://rstralberg.com

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