#23 – New Program: Convertor

My newest program is called “Convertor.”

I post a lot less often than I could, but I’ve been working on the Windows API for about a few weeks now.  I lose track of time so easily…

But anyways, it is a simple converter from inches to feet using just the Windows API and some C++ and C standard library functions.  You can find it here:

http://www.mediafire.com/?xw1zsct6ltzif

It’s useless, but it’s an accomplishment to me due to how much trouble I went through just to make this work.  I never though it would actually run, but it did.  It took about, maybe, a week or two.

Sad, but good!  At least I’m making progress…

wxWidgets or WinAPI?

I’m actually wondering which one I should take.  I want some flexibility within my programs so I can eventually create great games with many control features, but I’m not sure which has more customization.  wxWidgets is cross-platform, but most people use Windows.  It may have the ease of OOP based programming, but is it customizable? That’s my big question.  The Windows API seems messy, and though, the program is just, what, 157 lines long? It’s much too complicated and long, in my own opinion.

I suppose it’s time for more research.

 

#22 – Dice 8

Download it here:   http://www.mediafire.com/?4hkgr94rmegu3eb

Download the source code here:  http://www.mediafire.com/?rfgdtll8hkiag62

Yes, I’ve finally finished my first game: Dice 8.

Development has been a little bit quiet since my computer got wiped.  I was forced to bring it back to factory state and do a system restore.  However, the good news is that I was able to start programming again after I re-downloaded the Code::Blocks IDE.  I find Code::Blocks the ONLY IDE I was able to set up, and so, it has become my only IDE.  I couldn’t find out how to get Eclipse to work, and how to get NetBeans to extend its functionality to C++.   I am currently using the MinGW compiler that optionally comes with Code::Blocks.

Dice 8 is a simple game that uses:

  • iostream
  • cstdlib (The C standard library, I’m assuming?)
  • ctime (Part of cstdlib?)
  • conio.h (Have no idea about this)
  • process.h (Have no idea about this too)

I have imposed no copyright on it; how could I anyways?  It’s a pathetic little program that pits you against another person to roll the same number as the computer.  You can only choose the numbers 1 – 8.

I figured I should use a string to store all input information–after all, you can’t go wrong if you can store both characters and numbers.  When the user is required to input a number, even inputting “c” or “%623498″ will not crash the program.  The code used to get input from the user is here:

int getInt() {

 unsigned int number = 0;

 while ((number !=  1) || (number !=2) || (number !=3) || (number !=4) || (number !=5) || (number !=6) || (number !=7) ||(number != 8)) {

 cin >> linein;
 number = atoi(linein.c_str());

 if ((number == 1) || (number == 2) || (number == 3) || (number == 4) || (number == 5) || (number == 6) || (number == 7) || (number == 8)) {

 break;
 }
 else {
 system("cls");
 cout << "You have input an invalid string of characters." << endl;
 cout << "Please input a number from 1 to 8: ";
 }
 }
 return number;
}

As you can see, I still use the std::in for getting input, but it puts the input in a global variable named “linein,” which is my shorthand for “the input line/string.”   linein is then converted to an integer by the function atoi().  If the value stored in linein is not an integer, because the int number cannot hold character data, any letters or special characters are not accepted.  This function, getInt(), then compares the integer number to the integer constants 1 through 8, and if int number is equal to 1, 2, 3, 4, 5, 6, 7, or 8, then the while-if-else statement is broken, and getInt() function then returns the current value of the integer number, which is limited to 1 through 8 (because you checked number to see if it was a number between 1 or 8).

This entire function ensures that the user’s input is guaranteed converted to a valid integer.

You may look at the source code yourself.  It has already been uploaded to MediaFire.

#21 – HAPPY NEW YEAR (Taking a break)

Hello, everybody.  I just discovered a really cool function on Windows 7!  The voice recognition is actually really good.  I’m actually typing this entire post using the Windows Voice Recognition right now.

 

Any ways, the real reason I posted this post was to inform you a happy new year!  All be taking a little break from programming right now so, I suppose they’ll be a little while until I post again.  Until then have a happy new year!

#20 – TTGEE Dev. – Wiped!

Hello, everyone. My computer has just umdergone a system restore.

Yes, this also means that all of my work and code is gone. I can’t even work with an IDE because it’s not installed on my computer.

I’m typing all this using the smartphone. Oh well.

At least school is out.

#19 – ThsotusTextEngine – Development 1

“Save the Princess!” was simply a test.  It was a very pitiful test.  Today, I begin my work into creating a text-based game engine and editor that will create dialogue for me.  It will be called “ThsotusTextEngine,” and I am developing it right now.

The plan is to use a “markup” language to create a game.  For example, if I put “&” on a line, perhaps it might mean “create a pause here.”   The hard part, for me, is going to be doing basic text I/O with C++.  It’s a lot easier with Java, but with C++, you need to be a little more careful.  I will be perfecting this within the next few weeks.

#18 – Save the Princess!

Hello everyone, I’ve been absent from this blog for awhile now, but I’ve finally done it!

My first game: “Save the Princess!”

It is written in C++ and is a text-based game.

It should take less than 1 minute to finish.  Yes.  It’s just an experiment, with basic variables, logic, and I/O.

I find that

cin >> variable name

is a lot easier to use than

Scanner scan = new Scanner(System.in);
 Main.chNo = scan.nextInt();

from Java.  I like C++.

 

The link to the file is here:   http://www.mediafire.com/?rv46z56co4kec

Enjoy!


#17 – Learning C++ – So much easier!

Hey guys, I’ve been gone for awhile.  Yeah, I know that no one barely com es here, but I hope it’ll become popular.

Now, I’ve been working and researching with C++.  Why is that?   This is because I’ve read about the downfalls of Java and the ups of C++.   C++ seems to be a much more powerful and faster programming language, not to mention how simple it is.  Sure, when I first looked at C++, I was hopelessly lost, but now, I understand.  Java helped me to introduce myself to all of these concepts, but it seems that Java cannot do all the things I want.  Plus, there are no really good tutorials for Java.  Because C++ is so popular, I’ve decided to go with the flow.

Also, I’ve stopped production on Twin Days.  Twin Days was a small learning project designed to give me more knowledge about programming, and, for the most part, it got me accustomed to Java.  It also made me realize that Java cannot do everything.  Java is very confusing when it comes to even the simple console input, but in C++, it is easily handled with the “cin” command (get it?  “c” and “in!”).  I find C++ to be a lot easier to understand once you get a grasp of the syntax, but C++ seems to be greater suited for gaming.

So, I’ve stopped researching Java and have been taking a look at C++ basics.  And, it seems that these tutorials do a much, much better job at explaining C++ than the Java tutorials did me.

I’ve been using the Code::Blocks and Mingw set-up, and I find Code::Blocks to be suitable to my needs for now.  Right now, I am beginning to see the light in pointers.

I’ve also decided to start on a new project soon, once I have enough ability to program.  It will be a simple sidescroller action game, perhaps just having a character whack a bag around to get points.  Of course, this will be a very boring game, but it will cover some game mechanisms such as:

  • Collision management
  • Point system (also can be applied to EXP and money)
  • Animation
  • Control
  • Input from using using keyboard

So, stay tuned for more!

 

Follow

Get every new post delivered to your Inbox.