Showing posts with label update. Show all posts
Showing posts with label update. Show all posts

Sunday, September 30, 2012

Back from the Brink

Hello to everyone! I am excited to say that I am coming back to this blog and to game programming as a whole. I have many things to update everyone on since my last visit here. Since my last post I have started a new job, moved to a new city, and bought a new car! Many things have changed for me now and I am happy to say that I am finally getting some time back on my hands to program again (as well as blog about it).

I hope everyone will forgive my absence over the last few months. Real life has been more crazy than normal, and I must say that I am ready for things to slow down for awhile. While I have enjoyed my time away from programming games, I am anxious to begin again, and with the upcoming release of Windows Phone 8, I am happy to say that (*spoiler alert*) I will be delving into the world of making games for the Windows Phone using my trusted friend, XNA Game Studio.

I am looking forward to beginning development on my next fun project, a simple 2D game (more details to come) for Windows Phone. Stay tuned for my next blog posts to read about the exciting work I will be doing in the world of the Windows Phone.

Sunday, February 5, 2012

Xna Platformer Update

Hey guys here is a quick update on my platformer game. I've been able to add in some decent player physics, modeled after the Platformer Starter Kit on the Xna website. I've also spent most of my time on the editor lately, getting it up to speed with my engine and designing it in such a way that I will be able to create platformer games much quicker than just hard-coding in the levels for this one game.

 

Thanks for taking the time to check up on my game. I'm really looking forward to developing the engine and editor even more. One of the things I'm in the process of adding is a dedicated object layer for the maps. Right now, the only thing on that object layer (which is loaded in from a file by the way) is the player. Most likely, the next thing I will add to the layer is an exit tile, which will load up the next level (tile map in my case). This, I feel, will make the game start to feel more like an actual game than just a level demo.

Stay tuned for more updates!

Wednesday, February 1, 2012

Prospectus Xna Relaunch

Hello everyone, I have exciting news to bring you today! I finally have discovered a way to make Prospectus available to everyone and utilize the ClickOnce feature which will allow for Prospectus to automatically update itself whenever a newer version is available.

My solution actually came about because I recently have been poking around on the dreamincode.net site and have become involved in a project that is hosted on CodePlex.com. Ironically enough, I was digging through their web site today and discovered that ClickOnce applications actually work on that site (my guess is because it is owned by Microsoft, but that may be incorrect).

Anyway, setting up the project was easy and I have uploaded the Alpha 1.0 version here. If you are a fan of the game, please stop by and download a copy (for free) of Prospectus, and it will update itself whenever I provide updates (pretty cool, huh?). Again, thanks for everyone who has followed along with this project and I do apologize for going so long without an update...and yes, for those of you wondering, this does mean that I'm back to using Xna for the development of Prospectus (let's face it, I love programming in C#)

Until next time!

Saturday, January 28, 2012

The Progress of My Platformer

Hey guys, it's been a few days and I thought I would update you on my current project, a classic platformer modeled after that oh so famous plumber we've all heard about before. Again, I'm back to using Xna for this project. For me, it's the simplest and quickest way to make a game the way I want to...through programming. I thought I would show you some video of the game so far. I'm also making an editor for the engine. Both of these started with Nick Gravelyn's Tile Engine series and have since branched off, as he made his engine for an rpg and mine is for a platformer.

On to the good stuff!
Here's a quick demo of the "game" so far (this is more of a tech demo than anything ;) )

I've done quite a few things with this game so far and I plan on going over some specifics with you soon, but for now I leave you with the flashy eye-candy that you've just seen. If you would like for me to cover something specifically that I'm doing in this game, please let me know in the comments. I like writing about game making and I like helping you guys out when I can.

That's all for now!

Thursday, January 19, 2012

Revisiting SDL and C++, a Log Class

Hello again, while I feel like I'm making progress with Nick Gravelyn's Tile Engine series in C#, I also want to brush up on my SDL/C++ programming, as I feel like that would be the most applicable to professional game studios. Therefore, I have decided to focus on making a simple shmup (shoot 'em up) while also working on the Rpg in C#. This new project will be in C++ using SDL (if you are unfamiliar with SDL, please take the time to read up at lazyfoo.net). It will be in the classic 2D style that you would have seen in an old SNES game.

I am very excited about this new venture and I anticipate this will help me complete one of my goals for this new year, actually finishing a game. By the way, for those of you wondering, I do plan to return to Prospectus in the future. Let's begin our new project with a basic overview. I am going to do some basic game framework coding in the beginning that can be reused in other game projects as well. I am following stayscrisp's tutorials over at dreamincode.net. After getting through the first 4 tutorials, we find that we have a basic game up and running with basic game state management, which will benefit us later on when we don't have to write that code after the game is done. I have followed his tutorials pretty much to the letter until this point and will quickly venture off and write my own code soon.

The first feature that I'm going to add to this basic game engine is the ability to have a global logging system that can be used to give feedback from the game via a log.txt file. This gives us a great debugging tool from the start because we can use this to monitor our game's activity while it is running. To start, we need a Logger.h added to our project. Here is the code I wrote for this class:

#ifndef Logger_H
#define Logger_H

#include <fstream>

class Logger {
    public:
        static Logger* Instance();
        bool open(const char* file);
        void log(int level, const char* message);
        bool close();
        
    private:
        Logger() {};
        Logger(Logger const&) {};
        Logger& operator=(Logger const&) {};
        static Logger* m_Instance;
        std::ofstream logFile;
};

#endif

You can see that we are making this class a singleton by creating an Instance() method that is static and returns a pointer to the Logger class. This will make sure that there is only one instance of this class at any one time in our game. The open() and close() methods are straight forward; they open and close the log file. The log() method is also very basic; it takes an integer to define the warning level of the message, and a string (const char*) for the actual message of the particular log entry.

Next up we have the Logger.cpp file to add to our project:

#include <iostream>
#include "Logger.h"

// Global static pointer used to ensure a single instance of the class
Logger* Logger::m_Instance = NULL;
    
// This function is called to create an instance of the class.
// By calling the private constructor through this method, we
// ensure that there is only one instance of this class at any point.
Logger* Logger::Instance() {
    if (!m_Instance) 
        m_Instance = new Logger;
        
    return m_Instance;
}

bool Logger::open(const char* file) {
    logFile.open(file);
}

void Logger::log(int level, const char* message) {
    switch (level) {
        case 0:
            logFile << "Debug - " << __DATE__ << " " << __TIME__ << " | " << message << std::endl;
            break;
        case 1:
            logFile << "Warning - " << __DATE__ << " " << __TIME__ << " | "  << message << std::endl;
            break;
        case 2:
            logFile << "Critical - " << __DATE__ << " " << __TIME__ << " | "  << message << std::endl;
            break;
        case 3:
            logFile << "Fatal - " << __DATE__ << " " << __TIME__ << " | "  << message << std::endl;
            break;
        default:
            logFile << __DATE__ << " " << __TIME__ << " | " << message << std::endl;
            break;
        }            
}

bool Logger::close() {
    logFile.close();
}

You can see that we create an instance of the class in the Instance() method. We also open and close the file in the open() and close() methods. The log() method uses a switch statement to determine which message to output, based on the level that was passed to the method. The __DATE__ and __TIME__ macros are a great addition as well, because they show us what time stamp the message was created at. And that's it! The Logger class is complete. Now to use it anywhere in the game all we have to do is make sure we include the header file in the .cpp file we want to use the Logger class, then call the log() method like so:

Logger::Instance()->log(-1, "----------------Game Initialized-------------\n");

or...
Logger::Instance()->log(-1, "PlayState has been loaded");

or...
Logger::Instance()->log(3, "Game failed to start, Quitting game now.");

Thanks everyone for reading and make sure to check back often as I will be making progress updates and simple informative posts such as this one in the future.