Thursday, May 19, 2011

Simple SMUP (Shootem up)

Its been a few weeks since I've posted on this blog.  Right now I'm working on a simple shoot'em up or smup for short.  For now its only a simple demo.  It has no collision dection or respose system yet so the player can't do any thing with the meteors.


As you can see its very basic.  You can't move up or down,  you are limited to move left or right.  Once I implemented it you'll be about to shoot with the z key which is the action button.  Also it won't be in windowed mode either  because windowed mode is really slow.


One thing about it is that is that there are 2 background.  One is a star background which move quite slow.  And the other is a meteor background to make it feel like you are in an asteroid field and it gives the map a little depth too :D.  Oh well I'll keep it posted. (btw the platformer project has be stalled for a while I'll start working on it after this project).

Saturday, May 7, 2011

Toki Toki Syntax 8D!!! In C++.

This is some silly test I did when I was working on one of my projects...  I started playing around with how c++ class work and came up with a way to make it look sort-of like query language.  It looks something like this :D

/*
 *     Toki Toki Syntax is just a simple way to make c++ classes look
 *  like queries :D
 *
 *  So MAHAHAHAHAHAHAHAHAHAAAAA!!!! Couph Couph Couph 8D
 */
#include <iostream>

using namespace std;

class Test {
    public:
        int num;
       
        Test() : num(0) {}
       
        Test* hello() {
            cout << "Hello World" << endl;
            num++;
            return this;
        }
       
        Test* moon() {
            cout << "Hello Moon" << endl;
            num++;
            return this;
        }
       
        Test* sun() {
            cout << "Hello Sun" << endl;
            num++;
            return this;
        }
       
        Test* stars() {
            cout << "Hello Stars" << endl;
            num++;
            return this;
        }
       
        int getNum() {
            return num;
        }
};

int main() {
    cout << "Toki Toki Syntax: Simple way to make c++ look like a query language :D" << endl;
    Test t;
    // WTF Am I reading :D
    cout << "Toki Toki: " << t.hello()->moon()->sun()->stars()->getNum() << " times!!!" << endl;
   
    return 0;
}

This is just boredom on my part but I thought it was quite funny.  Who knows this design might be useful if not have laugh it helps with blood pressure 8D. What even funnier is the output from this example it looks like this.

Hello World
Hello Moon
Hello Sun
Hello Stars
Toki Toki: 4 times!!!

I thought it would be something like this though.

Toki Toki:
Hello World
Hello Moon
Hello Sun
Hello Stars
4 times!!!

Oh well figured out some strange about the way methods are launched in c++. Peace!!!