Translate

Monday, April 28, 2014

New Super Smash Bros Pt. 2

Good morning/afternoon/evening fellow readers!

So if you haven't already seen the Nintendo Direct about the NSSB, you can watch and react along with these guys here.:


Now that we are all caught up, let's talk about the awesomeness of these upcoming games. In the last installment of my NSSB, I talked about how they are releasing the game on the 3DS, as well as the WiiU, which was amazing enough as it is. The 3DS will be coming out first, and I believe it will be coming out this summer, while the WiiU version comes out in the winter.

The next thing you will notice most likely when you see the Direct play is how beautiful this game is. Not even going into how crisp, smooth, and HD it looks (seriously though, have you looked at the substitute plushy?), the art direction is just fantastic in this game. They added new stages, and all of them beautiful, the characters look so much detailed, and the backgrounds are just really pretty to look at. I can literally pick up this game, go into a stage, and just gaze as its design for a while because of how spectacular it looks. You can tell that Nintendo put a lot of time and effort into this game, as if it was their little child. Oh Papa Nintendo, you really did raise them well.

In our next installment of NSSB, I will talk about the new and old stages they show off in the Direct, as well as other awesome things in relation to the stages.

Until then, have a great day~! :)


~Jelly

Sunday, April 27, 2014

Construct 2: Fighting Game Tutorial

Hi everyone! How's your week been? It was a busy for me. Finally, landed myself a small part-time job to tide me over for my money troubles (in other words: More games to buy XD), but I'll still be active on my blogs whenever I have chance.

So on that note, allow me to share with you something interesting that a friend showed me that you can make in Construct 2. It's a tutorial you can use to create your own fighting game! Following the tutorial, it's your basic setup on hitboxes, character sprites, lifebars, and directional inputs for move commands for your character. If you ever played with M.U.G.E.N, and used one of Elecbyte's creative tools (Fighter's Factory), it shouldn't be that difficult to see some similarity on how you create and modify your game for your characters. The only difference you'll see is the parameters that Construct 2 offers to make the process a bit easier in developing.


If you're interested in trying it out, just click on the link I provided for the tutorial. If you want to learn more about Construct 2 and how to use it, I also placed a link to the site if you want to download it and try out its free version before deciding wanting to buy the full version of it.

Well that's it from me for now. I'll be sure to drop more news with you guys and provide some more useful stuff that you guys may have interest in gaming development.

Laters :)

Construct 2:
 
https://www.scirra.com/construct2

Construct 2 - Beginner's Tutorial:

https://www.scirra.com/tutorials/37/beginners-guide-to-construct-2/page-1 

Construct 2 - Basic Fighting Tutorial:

https://www.scirra.com/tutorials/468/part3-basic-fighting-game-tutorial-video-series

Saturday, April 26, 2014

Displaying an image with SDL - basic C++ class structure

Today, we will create a simple image displaying program with SDL 2.0 and Mingw. This will help you understand some of the program structure related to C++ and how SDL used objects to render images on screen. We will be making a class to hold our program logic, and using that class to render an image to the screen.

Create header file; this file will hold our class, the one we will be building our program with. With a class, an entire object, with it’s variables and methods, can be encapsulated into a single object, to be used as needed or desired by a program. In our example, this class will run the loop for displaying our image to the screen, and for testing for user input.

Add the two includes at the very top of the file:

#include "SDL2/SDL.h"
#include <stdio.h>

And enter the following to start the class definition: class cpp_Application {

The class keyword will start the class definition for this header file, defining the name for the class as cpp_Application when an object of this class is created. After this definition, enter the next line below and type public: . This will define any method or variable with a public scope, meaning any method or variable can be used or see by anywhere in the program.

On the lines below, define the following 4 methods:

cpp_Application()   //The default constructor for C++ classes
~cpp_Application()   //The default constructor for C++ classes
Int executeProgram();   //Method to run the program in a loop; this method will be called to call all other loops
Int getInputEvent(SDL_Event* event)   //This method takes in a parameter of ‘SDL_Event’ type to check for user input. For this tutorial, it simply tests for interaction with the window.
Then, while still defining the class in the header file, type private: . This will define any methods and variables defined after this line only viewable and usable to this class only. This helps with a lot of the concepts that make C++, such as enabling data encapsulation to protect the data from being altered by another component in the program. In the next few lines in the header file, below the private: declaration, enter the following few variables:

bool running; //Boolean for program execution
SDL_Event    applicationEvent; //Event object for user interaction
SDL_Window*  applicationWindow = NULL; //The window to open and use for our program
SDL_Surface* windowSurface = NULL; //Surface object to be used with window for rendering.
SDL_Surface* testImage = NULL; //Basic bmp image for tutorial use

End the class definitions with };, like any other method. Please remember the semi-colon ‘;’, this tells the compiler that our class definition is done at this point.

Create another file, this time a .cpp file, but name it after the .h file. When this file is opened, type #include “headerName.h”. This line will ‘include’ the header file in the source when compiling this cpp file, looking at it for the definitions and boundaries of the data.  Don’t forget to also include the “SDL2/SDL.h” file as well.

In the cpp file, we add the definitions to all the methods defined in the class in the header file. Starting with the constructor method:

CPP_Application::CPP_Application(void) //Default constructor
{
   running = true; //Set running boolean to true
   SDL_Init( SDL_INIT_VIDEO ); //Initialize SDL
   applicationWindow = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED , 800, 600, SDL_WINDOW_SHOWN); //Create Window for SDL
   windowSurface = SDL_GetWindowSurface( applicationWindow ); //Get the surface for the created window, and return it to a Surface object
   testImage = SDL_LoadBMP( "imagefilename" );
   if( testImage == NULL ) //Tests to see if image loaded properly, if not, then an error message is displayed
   {
       printf( "Unable to load image %s! SDL Error: %s\n", "testImage.bmp", SDL_GetError() );
       running = false; }
};

First note, this method starts with the class name and :: . This is because we are defining the function of the method declared in the class, and ‘::’ tells the compiler that this function’s scope is being defined for that classes method. So every method declared in a class that needs a definition should start with the original classes name and ::.

This first method is the constructor method, which is called first every time an object of className type is created. This constructor method will initialize every variable needed to start this class; in our case, it will set the running Boolean variable to true, initialize SDL with SDL_Init(SDL_INIT_VIDEO), and initialize all the objects in our class by calling the appropriate methods. applicationWindow will be created when SDL_CreateWindow() returns; windowSurface will be initialized with SDL_GetWindowSurface(), that method being passed the already created window for our program. And finally, our image object testImage will be called and initialize with our image file to display with SDL_LoadBMP(). If the image file is NULL, our program tests for this, and ends execution if the testImage is NULL. Note that the window dimensions are 800 to 600, this will e important for our image. Note also our image being loaded is a .bmp file; we will need this format for this tutorial. This image format is easily found in MS Paint, which will suffice for our needs.

With our constructor defined, defining our destructor will be easier. Enter the following:

CPP_Application::~CPP_Application(void) //Default destructor
{
   SDL_Quit();
};

Again, note the class name and use of :: for scope definition. This method simply calls SDL_Quit(), which will end execution and use of SDL and close all objects related to SDL before closing the object itself. Also note the tilde ‘~’ character by the number 1 on your keyboard; this character is specifically for defining a destructor.

The next method to define will give us our program loop:

int CPP_Application::executeApplication() //Function to run when program starts execution, main loop
{
   while(running)
   {
      //Render the image
      SDL_BlitSurface(testImage, NULL, windowSurface, NULL);
      SDL_UpdateWindowSurface(applicationWindow);
     
      //Get the input from the window
      getUserInput(&applicationEvent);
   };
};

The function starts with a while loop, with our running Boolean as a conditional; when this Boolean is set to false, this loop ends and the program with it. While this loop executes, the following methods will be called repeatedly:

SDL_BlitSurface() : Taking four arguments, this method will blit, or draw an image to our surface. The first parameter is our image to blit, the second one is NULL (normally used to define the boundary size for the first parameter), the third parameter is our window surface (the one defined in the constructor), and the fourth is NULL (again, used for boundary sized for the third parameter). This method tells the computer to draw this first image unto the latter image defined in the third parameter.

SDL_UpdateWindowSurface() : Taking the SDL_Window object as an argument, this method simply redraws our window to display our current image.

And the third method called in the loop is the fourth method defined in our class, getUserInput().

The fourth method defined in our class is the getUserInput(SDL_Event) method. This method takes an SDL_Event pointer object as a parameter, which is a way for SDL to check for user input from various devices. When a user event is detected, this method will call to check for what kind of even has happened by calling SDL_PollEvent(event) != 0 . If the event object isn’t NULL, then it is compared to several flags that indicate the current status of the program: in our tutorial, all we do is check for end program conditions, and set the running Boolean to false if the window was exited out of by the button at the top-right.

From here, in the .cpp file, define the main() method below the other definitions. Once ready, simply enter the following code in the main:

CPP_Application application;
application.executeApplication();
return 0;
These lines will define as object of our class by name for its type, and by the name application for its object name. The object name is the name called by the program to reference the object of the class type defined. This object will have its executeApplication() method called, which will start the loop to run the program and display our image. And the last line will return 0, ending our program execution after the loop exits.

With these two files, create and enter a new directory and find the SDL2.dll – you will need to move that .dll into your new directory to make this program, or any program that uses SDL2 to even start up. When you have the .dll file for SDL2 inside the same directory as your .h and .cpp files, start up MS Paint.

In MS Paint, simply create an image of 800 by 600 pixels (or as close as you can) and add whatever colors, text, or drawing you would like to see displayed to the window. Remember to save this image as a .bmp file, so that our program can load it into our Surface object. Save this file in the same directory as the other files, and save it to an easily remembered name, like test.bmp or image.bmp. Before compiling the source code, remember to go back into the .cpp file and add the image file name to the SDL_LoadBMP method between two quotation marks, with the .bmp file type at the end (i.e : “image.bmp”).

With all this done, enter the command prompt and maneuver to the directory with all the files you’ve just made. Enter the following command to compile and link this program:

g++ -o SDL2.exe cpp_Application.h cpp_Application.cpp –lmingw32 –lSDL2main –lSDL2

If the compilation and linking goes well, the execution of your program should display the image you just drew in MS Paint!

Wednesday, April 23, 2014

New Super Smash Bros.

Good morning/afternoon/evening fellow readers!

So let's be honest here: Who ISN'T hyped about the new Super Smash Bros game? It has been a popular brawler since its first game, Super Smash Bros. I personally started on the Smash Bros. Train when Melee came out. But this isn't a Nintendo 64 or a GameCube we are talking about today. We are talking about the new one coming out soon, first for the 3DS and finally for the WiiU. 

First of all, it's already an awesome surprise that they are actually making this game for a handheld. Usually when Nintendo has something they know the audience likes, they don't stray too far from what they usually do for that type of title. Now they are expanding a popular series to a handheld system! That is one of the coolest ideas they have done. Not only do people have two different ways of playing the game, each game for each console having its own benefits, but it also ensures that people that don't have the WiiU get to enjoy the awesomeness that is Super Smash Bros.

Now if you saw the Nintendo Direct for the new Super Smash Bros. game, you know how awesome the game looks for both systems. This was the game everyone has been looking forward to for the longest time. I don't know about you, but even though I have a 3DS and not a WiiU, I really want to get a WiiU so I can play the NSSB game. The question is "Will this game save the Nintendo WiiU?" 

Well, it's definitely a possibility. There is SO much hype for this game, it could blow you away. Look at it this way, even if everyone one is like “Oh no, why should I get the WiiU when I can play it on my 3DS?” there’s still a lot of people that don’t have a 3DS.  With so many people on the edges of their seats, barely able to wait for the 3DS release, there’s no way that this is going to have a bad turnout.  Most people aren’t going to let this game pass by them. If they did, they probably aren’t into brawlers or just don’t like Nintendo very much. You can bring up the “Oh, I’m too broke” but let’s be honest: How many times have you splurged money on something that you really couldn’t afford?  About everyone at least once, unless you are a child that can’t afford those things, but in a lot of those cases, most of those families live in homes and can already afford these products if they don’t have them already.

Let’s face it; people are going to get what they want, even if it’s not good for them.  And there is a LOT of people that want this NSSB game. There will be systems bought, whether handheld or console, and there will be a lot of game stores having long lines of people waiting for their preorders and others feeling pretty bad that they didn’t preorder. I know I’m going to get the NSSB game no matter what it takes (except for stealing, because I wouldn’t do that, and you shouldn’t either!).

Now in my next post, we will start talking about the game itself. Until then, though, I hope you have a great day! :)


~Jelly

Saturday, April 19, 2014

My Apologies

Good morning/afternoon/evening to my fellow readers.

I would just personally like to apologize for not being as active as I should. I have been trying to think of what to talk about with you guys and gals. I was thinking that maybe I can record me playing some games and show them here.

Then I ran into computer problems, and now it's really slow. And I don't know why yet. I've deleted and uninstalled things that I don't need, and I've ran Antivirus, Anti-malware, and Anti-spyware. It seems like its gotten a little better, but then again, I haven't tried multi-tasking that I like to do. Anyway, I have to make sure my computer is ok before we talk about other subjects. I apologize for the inconvenience.

But when you see me again, you bet that you will here a lot about the new SSBB. I know everyone is excited for that game, and so am I.

Until then, I hope you have a great day! :)

~Jelly

Friday, April 18, 2014

SDL 2.0 - Integrating with MinGW

Today, I’d like to start working with a multimedia library known as Simple Direct Media Layer (SDL.) SDL is a cross platform development library that provides access to low-level functionality, such as audio, graphics, and HID (human interaction devices) such as a keypad and a mouse. Written in C, it has become one of the most popular and widely used libraries for multiplatform development available, and utilizing it will help us understand all the components that make up a game to a whole.

We will be downloading SDL 2.0, the latest release, and extracting the library into our MinGW folder. GO to the sdl homepage and click on ‘SDL 2.0’ near the left, and click the link that says SDL2-devel-2.0.3-mingw.tar.gz to start the download for SDL 2.0. When it finishes, move the .tar file to a directory on you C:\ hard drive. From this directory, we will be utilizing the tar command (tape archive) to extract this file, using the following flags:

Z: Indicates using the g-zip command to extract the files using the DEFLATE algorithm.
X: Flag that tells tar to extract to the disk from the archive.
V: Verbose; a command used to show the progress and file names while extracting from a file to the disk.
F: File flag, points to the string of the object being extracted, indicating it’s a file.

While in the directory that .tar file sits in, type the following command :

Tar –zxvf SDL2-devel-2.0.3-mingw.tar.gz

This will extract the files for SDL2 from the .tar file, into the directory. You should now see SDL2-2.0.3 for a folder in this directory. This contains all the files to work with SDL 2.0 in your projects, including header files, library objects and the necessary dll.

Now then, we will be extracting all these files into you MinGW directory and moving the .dll object into the Windows system, that way our compiler can utilize SDL without having to look through different directories. First, use the move command from one of our earlier tutorials, and find you MinGW directory (likely right on the C:\ drive) to find it’s include directory in the x86_64-w64-mingw32 folder. This directory holds the include files for your current platform (Windows 64-bit) which will be searched through for the libraries and header files. When you know where this file’s location is, write down or memorize this string name at the top, in the address bar – you will be moving a lot of files from your SDL 2.0 directory into this directory here.

Navigate to the SDL directory and find and enter the same x86_64-w64-mingw32 folder as found in the MinGW directory, and from there find the include folder. Enter this folder, there should be a folder named SDL2, move this folders into the include directory of MinGW with the move command, like so:

Move SDL2 C:\MinGW\x86_64-w64-mingw32\include\

This should be a quick procedure for the computer, since the files won’t be copied, but simply moved instead. From here, enter cd .. to move back to the previous directory, and then cd lib to move into the lib folder, containing the necessary .a files for MinGW to utilize. From here, take advantage of the wildcard character ‘*’ and move the .a files by typing:

 move *.a C:\MinGW\x86_64-w64-mingw32\lib\
 
Then, with the libraries and header files in the right places, simple navigate back with cd .. to the bin folder (cd bin) and type:

 move SDL2.dll C:\Windows\sysWOW64\

This will move the .dll into the windows directory for the dll files (You may need to restart the command prompt with administrator privileges to be able to do this right.)

With all the files in the right places, the only thing left to do is test this with a simple program. Move to an empty directory or create one, and from there, enter notepad sdl-test.cpp to create a file for testing sdl. In this file, enter the following source:

#include "SDL2/SDL.h"

int main( int argc, char* args[] ) {
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );
    //Quit SDL
    SDL_Quit(); 
    return 0;    }

This code will simply initialize SDL and then quit SDL. If this simple program compiles and links properly, at least we will know that SDL2 has integrated with MinGW. Enter the following into the command prompt:

g++ -o sdl2.exe sdl-test.cpp -lmingw32 -lSDLmain –lSDL.

If you get an error stating that the header file cannot be found, then the include folder is likely in the wrong include folder in the MinGW directory. If the compilation states that the libraries are missing, then the libraries are in the wrong lib folder. Remember to insert these files into the x86_64-w64-mingw32 directory in MinGW.


Well, this was quite a bit of work, but assuming it went as planned, we should finally be ready to begin coding with C/C++, making a game with SDL (and OpenGL for graphics later on). Have a great day, and read up on SDL for future reference! :D

Friday, April 11, 2014

Batman: Arkham Origins, Tomb Raider

Yo Y'all XD!

How has everyone's day been? Good I hope. It's been a tiresome week for me. Been traveling around job searching and not much luck so far. I'm still trying though until I land one eventually. How else am I going to be able to get a PS4 someday, lol.

Anyways, just picked up Batman: Arkham Origins from Gamefly. Been getting some bad reviews on it though, including the fact that this game wasn't primarily made by Rocksteady. So we'll see how it is through the first 10 mins. If not, that's why you got to love Gamefly. I'll be looking forward to Batman: Arkham Knight when it comes out though. It's going to be epic XD.

As for Tomb Raider, I haven't played it in a while. I'm still mid-way through the game so I'll catch up on it sooner or later.

Well...that was short and sweet. Hopefully, I'll have more content and news for you guys on my next post. For now, that's enough spit from me.

Have a good weekend break :)

The GNU Debugger (GDB)

Hello, and today, I’d like to guide you through the GNU project DeBugger, also known by its command line name of GDB. GDB is a debugging program that can stop and start your program executable, and analyze it’s variables and methods as it runs. Using GDB, you can stop your program at break point to study and analyze the current state of the executable, and get a better glimpse of any issues or errors in the program. A debugger is the best tool to find bugs like faulty variable values, and for finding the reason certain programs crash.
 

In order to work with GDB, you will need to compile your programs with the ‘–g’ flag on the command line. This will enable the gdb to read the source file along with the executable by compiling the necessary information from the source with the executable, and it is necessary to enable and access a lot of the features available in gdb. For this tutorial, please compile the tokenizer code from the last tutorial for our experiment today, like so:

G++ -Wall commandlinearg.cpp –g –o lineArg.exe
 
This will set the program just compiled with the necessary debugging information for GDB to perform actions such as back tracing and break points. It will also enable GDB to print variables found in the program as it runs, so that we may analyze them for possible errors, or to simply see them perform in action.

Now, in the directory of the executable you’ve just compiled, type GDB executableName.exe. You can also This will run the debugger in the command line, with the executable loaded and ready for running. Before running the executable, set some break points by using the keyword break, followed by either a number, or a function name from inside the source used to compile your executable (or in case there are multiple files used break filename.*:number or method).

 If you use the number, the number used will represent a line in the source file used. It isn’t necessary to have access to the source, because everything is included in the executable, or the object file. For our example executable, please use break 27 and break wordCounter, which will set two break points at the line specified, and at line 43, the beginning of the wordCOunter method.

Also, before running the program, type display argc. This will display the value of the command line argument argc, which gives the number of arguments being passed to the program. This value will be displayed every time the program stops execution at a break point.

Now, to run the executable with an argument, type run “Command Line Argument” which will run the executable with “Command Line Argument” as a parameter.

Execution stops first in the wordCounter method; when it does, it will display the argc variable, and the value it holds (it should be 2). It should also display the current line the debugger has stopped at, along with display the source line. To see the next line of code, type step. This will move the program and debugger to the next line of code, redisplay argc along with the line of code at the next line of the source. Type step again to get to the next line, this will initialize the wordCount variable to one, like in the source. Type print wordCount to confirm the integer has been initialized. When your finished, type bt or backtrace to see the path of execution for methods used in this program. This command will display the methods used up to the current position of the program the debugger is in. When your finished with this method, type continue to finish the method and continue back to main, to the next break point, at line 27.

Use this point to practice the command I’ve shown you; use the source file as a reference, and try to use break with a file name to practice it’s use with multiple file when the time comes. Also, try using the debugger with other executables, like the other executables in previous tutorials. Using the debugger is extremely useful for programmers, and learning this will help you figure out how a program ticks, and where problems are at to fix. And getting comfortable with GDB is a lot quicker that going in-between many different debuggers like in Visual Studio, or other IED-based debuggers.

Monday, April 7, 2014

Tokenize a string with command line arguments

The tutorial for today will explore how to parse a string in c++. Parsing a string or line of characters is a crucial exercise in programming, as many programs will need to read lines of code for bites of data, usually held in character-based strings. Parsing is seen in many different aspects of programming, from networking programs that need to parse a URL, to a graphics engine that needs to parse a model file for a 3D shape, to a program like Microsoft Office that measures then number of words in a document or selected line of text.

Further, we will be implementing this program with command line arguments. These are the parameters found in the main() function: argc and argc[], which respectively stand for argument count and argument vector. Argc is an integer type that holds the number of arguments being passed to the program when it runs, and argv[] is an array of C-style character strings, the size of argc. These strings in argv can be simple strings, such as in our case; but they can also provide strings like address paths for files like image files and text files that hold data.

We will be taking normal string arguments for our program, and parsing them by counting the number of words inside each string by checking for whitespace i.e. ‘ ‘ in each string to determine an instance of a word. The strings will be normal, double quotation strings (“ ”) like in C++.

The first line in the main() function is a call to printf(), with a string supplied as the first argument and argv[0] as the second. The string "Program name %s\n" will output “Program name” and the name you give the program when you compile it: it is the name of that application being ran, and this is the case for every application that the first argument in argv[] is the applications name. The %s inside the string is a flag, indicating where certain text goes in that string. The %s indicates a string variable, with argv[0] being supplied as the string to copy into the position ‘%s’ is at in the string.

An important point to make for argv[]: it is always ended with a ‘NULL’ value. This means that that value will need to be tested for when parsing our command line arguments, which is what we do in the first ‘for’ loop in the ‘if’ loop, and again in the second ‘for’ loop below the first. This also means that a minimum of two arguments are in each instance of argv; the executable name and a ‘NULL’ value to indicate the end of the argument list. This is to enable the argument vector to have an end point to test for, to prevent an infinite loop in the main function.

The second ‘for’ loop will be the loop where we tokenize our string, meaning to break the string into several words, or in our case to simply count the words inside a string. Tokenization is crucial for areas of programming that require the analysis of strings, and in the case of data security, the masking of sensitive data with reference variables. Our argument is passed to a string variable, which is then passed to the wordCount method.

Each character in the string supplied with the call to wordCounter(string) is analyzed in this method. The if() loop will test each input character to determine two conditions; A: if that first character is whitespace, and B: if the character before the first is not whitespace (to prevent counting multiple spaces as a word). If these two conditions are met, then the integer wordCount is incremented. When the line is fully read, the method will return the value of wordCount to the count variable in the ‘if’ loop. After that, the program will output a message with the count variable, displaying the number of words counted in the string.

Navigate in the command prompt to the location of your testing area, start notepad and create a .cpp file, and copy and paste the code below; when finished, save the file and compile it using:

G++ -Wall filename.cpp –o applicationName.exe
And when you run the executable, on the right hand side, add some strings in double-quotation marks, like so:

applicationName.exe “Hello There!” “:D How are you?” “Good, thank you very much”
Your program will output the application name, followed by the strings you’ve input. Then the strings will be analyzed by the method wordCount, which will output both the string, and the message with the word count.

New Terms:

Tokenization: The programming act of separating the words in a string, either counting them or moving them into separate data structures altogether.

argc: The main() parameter that holds the number of arguments passed into the application. Use this to keep count of the arguments: remember that there will always be at least two elements, so test for a number >= 2 to test for any arguments passed into the application.

argv[]: The second main() parameter; this one holds the actual string arguments that the application will be working with. Remember that the first value (argv[0]) will always be the application name, and that the last element (argv[last]) will always be a NULL value. Remember to test for the NULL value, and never pass it to any methods.

Code

#include <stdio.h>
#include <string>
#include <iostream>

int wordCounter(std::string);

int main( int argc, char *argv[] ) 
{
   printf("Program name %s\n", argv[0]);

   if( argc >= 2 )
   {
      for(int i = 0; i <= argc; i++)
         {
              if(argv[i] != NULL) printf("%s \n", argv[i]);
              else continue;
         }
        
         for(int i = 1; i <= argc; i++)
         {
              if(argv[i] != NULL) {
                     std::string argument = argv[i];
             
                     printf("%s \n", argv[i]); //Print the argument
             
                     int count = wordCounter(argument);

                     printf("The number of words in this line is %i \n", count);
                     }
              else
                     continue;
         }
   }
   else
   {
      printf("No arguments were supplied.\n");
   }
  
   return 0;
}

int wordCounter(std::string line)
{
       int wordCount = 1; //initialize to one word counted
      
       for(unsigned int i = 0; i < line.length(); i++)
              {
                     if(line[i] == ' ' && line[i - 1] != ' ')
                           wordCount++;
              }
       return wordCount;

}

Thursday, April 3, 2014

Blazblue: Chrono Phantasm, Tomb Raider (2013), Construct 2

Hey Everyone!

How's everyone? It's been a cold week with a lot of strong winds hitting around. Hope the weather has been nice for you.

Blazblue: Chrono Phantasm had come out this past weekend on PS3 (Darn it Microsoft! Why fail so hard in getting Blazblue: CP to work on Xbox!?).  *Ahem* Yea...it is finally out on shelves to play and I don't have the luxury of playing it until Arc Systems gets it going with its PS4 version, or digital download for PSN Plus+. Orrr....I could steal my sister's PS3 and use it to play it until I get a PS4 (lol, jk). But I am miffed that others are already lucky enough to play it aside from those that played from it's Japanese import. My time will soon come for it sometime...eventually...

Anyways, on to other news, I picked up Tomb Raider on Steam during one of their daily deals. Did a small playthrough of the game and liking it some far. The button sequence though kind of throws me off a bit when it unexpectedly enters you into it. Died quite a lot a few times after finally getting it. Now the choice is how will I grow in this game, shall I be a Survivor....or the Hunter :).

As for my gaming developments, I'm toying with Construct 2. I've seen some good platformers made by various people, and I still have yet to ponder what I could create myself. For now, I'll try building off some examples and test out some AI programming.

Well that's all for now folks. Hope you have a great day :)