Jump to content

C/C++ tutorials documenting my first project (WIP)


Mumbles
 Share

Recommended Posts

For anyone who doesn't know by now, I'm currently using Leadwerks to write a clone if the old classic Quake (specifically, the multiplayer one, Quake 3).

 

This is designed to act as simple game which I can then further expand, and build into an even better game. But also, I'll be documenting every step of the way so that others can hopefully learn from it. But I'm going to be writing it in C++ which isn't very helpful to those who don't understand C++ syntax.

 

I therefore thought that I should dedicate the first few chapters to attempting to explain C++ for those who don't know. Whilst at the start of chapter 1 I had hoped it would be simple enough for anyone to understand (including non-programmers), I don't know if I introduce too much too quickly, and so possibly confusing people.

 

The first four chapters that I've uploaded today don't include any coding with Leadwerks at all, so there's just a warning if you're expecting to see some game source code straight away. The later chapters, which I'll upload when they're done will involve using all of: Leadwerks, Newton and Winsock all within the same C++ project.

 

The first four chapters can be run on any operating system, using any C++ compiler you feel like. I describe getting a simple Visual Studio console solution up and running in windows, and for a bit of patriotism if nothing else, building a C++ program on Linux using g++ (Yes, I know that any Linux user here probably already knows this, but still).

 

After that it will be a windows only endeavour, not least because Leadwerks doesn't compile natively on Linux, but also because will be using the windows Newton SDK, and of course, winsock (of which the clue is in the name).

 

So yeah, I'll be updating this thread with new chapters as and when I finish them, even if there appears to be no interest, starting today. The tutorials are all in html format but not with nice fancy pictures unfortunately, just boring plain text. If you don't like the colours, then just change the body tag, but I found a white background gharish to look at, not least because I spent so long looking at it. All the html files are all packed together in a rar file.

 

As a side note, for those who will be using these first four chapters to learn C++. I found at school, college and even at uni, after a bit of reading, the best way to try and make it "stick" in your mind is to try and answer some questions about what you have just read. Because of this, there are some questions at the end of each chapter, with some answers too. Hopefully it is of some use to someone.

 

Also would it too much to ask if some C++ gurus could look over it to make sure I'm not actually teaching any incorrect information? (There are a few cases where I teach something in a simplified way, and then reteach it properly in a later chapter, but there might be some things that are wrong, and left that way.)

 

I should add that in the early chapters, I say that the string is a struct, when it's actually a class, this was something to be revealed in chapter 5...

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Great idea in general, but blue font on the black background is not too readable (as for me).

 

I'm sort of used to that, but you can change the style part of the body tag a new hex colour and it should change the all the text in that. I have my terminals set up in that colour scheme so I keep forgetting that its bizarre to everyone else

 

But I'll change it white text against black background. Unless people really want black text against white background... I just think a white background is awful to look at. (Will be re-uploaded in a few minutes - Done, original post has the new attachment)

 

...I just wish I knew how to make the colours user definable, but C seems to be the only language I really know... :)

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Chapter 5 added, The first chapter that involves using Leadwerks, only basic level mind you.

 

Minor editing of the Rotating cube app that Roland's Project wizard creates.

 

Edit: Whoops, forgot to include the library you needed, it's there now...

 

Edit 2: Oh, chapter 5 answers, second code snippet has redeclares the tickers, Obviously that's a typo. When chapter 6 goes up, that bit of chapter 5 answers will be fixed.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Chapter 6 now available (First post)

 

Topic covers basic loading of a sandbox scene (models only). But once you know what it's doing, you should be able to adapt it to do lights, and any custom classes (triggers maybe?)...

 

...Next, integrating with an external newton, followed by camera controls, and applying forces / torque

 

Edit: I forgot to mention, mlib changed between chapter 5 and chapter 6 so remember to replace your existing version because this chapter uses it quite a bit... Also Ive somehow overwritten the the first 2 lines of chapter 5, where it just tells you to create a new project using the project wizard.

 

Those two issues are now fixed - didn't want to change the file whilst people were trying to download it.

LE Version: 2.50 (Eventually)

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