Mostrando postagens com marcador Programming. Mostrar todas as postagens
Mostrando postagens com marcador Programming. Mostrar todas as postagens

segunda-feira, 14 de novembro de 2011

Make a Game - "Avoiding Game"


So let's talk about our game.

I've put it up on Google Code. You're gonna need a subversion client like Tortoise to download the files. But you can browse the sources code in the web.
If you wanna run the project, you're gonna to import them on Eclipse and fix up some folder problems that will. It's basically properties => Java Build and changing the folders of some Jar files of libGDX. If it doesn't work, just copy the codes in to another project.

Project in Google Code

Screen of the Game. Can Raphael survive this?


So now let me talk about the 3 packages(basically folders) in which I've divided the source code:

Game Package
This package is more libGDX oriented, featuring the Game class and two Screens. The first screen is for the actual game stuff, avoiding the devils and getting the feathers. The other screen is what happens when you lose the game. You can see your highest score yet there and also restart the game.

The main screen will basically draw what the Setup of the Logic Package tells it to draw, and will also send input information to the Setup class.

Logic Package
Handles what actually happens in the game.

  • The Setup class will receive interaction from the Game Package and will handle the main logic of the things, like managing all the beings in the game, including the player. 
  • Every being in the game is an GameObject, which is basically the enemies, the feathers and the player's avatar. 
  • The Board class handles movement of the GameObjects and collision detection
  • The Drawable class holds information on how the objects should be drawn in the screen
  • The GameObjectFactory class allows you to create GameObjects from Beans of the Bean Package. By messing around with this class you can add new enemy behaviors or object behaviors. You could make the feather move around or let the enemy stand still. Anything.
  • The Global class is used to hold the highest score.
  • ScoreListener is an interface to handle changes in score.
  • CollisionResponse is an interface used with collision detection
Collision detection is an important aspect of game programming. It's basically a way of knowing if two objects are touching or not.

In our game, detection collision is pretty simple, since all objects are treated as rectangles, so it's just code that checks if the two rectangles are colliding.

Bean Package
This package holds information about enemies and objects, so the GameObjectFactory can create GameObjects with the properties described by the bean.
The ObjectBean class holds all the possible behavior description for an enemy or an object. By tweaking those objects, the GameObject created later will behave differently.
The SpawnBean holds information about which object beans will be used in the game.

Play with the Code
Mess around with the code, specially the objectBean and the GameObjectFactory, so you can tweak the enemies or create new things.

Understand libGDX and make your own game! :)

Coming up next...
We're going to see sounds next.

Look forward to it!

segunda-feira, 31 de outubro de 2011

The game you wanna play is the game you should make!

What I mean to say is, if you're an indie game designer, you should design the game experience you enjoy!
Design games in your favorite style or games you really wish you could play!
Does that mean it'll be extremely popular? Maybe. If you like something really mainstream, like first person shooters or something, then yes!
But if you like rabbit political fighting games you probably won't get a very good audience for a game like that. But that's not the point!

The real point is threefold!

The first one is: if you're making the game experience you want to make, you'll be happier making it. If you find pleasure in what you do, you'll have a higher probability of actually getting the game finished. Unfinished games are a plague in the indie game industry and you should fight it in anyway you can!

The second one: if you're making the game you really enjoy, you'll be more in sync with the needs of the gamer, since you'll have the experiences from playing those games, and you'll be able to find flaws more easily in the design of the game, so you'l be able to make the whole experience much better! You'll be able to create the features that the players that enjoy that type of game really want, since you're one of them. Who are those players that enjoy this one type of game...? That brings us in to the third point.

The third one: normally, the players that play indie games are looking for an experience they can't find in the regular game industry, so they'll have peculiar tastes. They are a combination of niche markets that you want to reach out for! And how do you know if that niche market exists for your game? Well, if you like that style of game, then you are already a niche market! And if you make a game that you really wanna play other people may want that same game you always wanted! No matter how weird your idea is, it most likely has a niche market somewhere that you should reach out for, instead of making one more generic platformer game.

Those are my three points for why you should design the games you wish you could play: Motivation, Quality and Niche Market.

I, myself, really enjoy story-oriented games, so the games I make tend to focus a lot of them, and I center the story in the qualities I really like. I might return to this later!

The most important thing is to keep on making them! But if you enjoy it, it's much better, right?

Hugs, readers!

HOW to be a Game Programmer?

I'm gonna start with something pretty beginner-oriented and not too specific.
So you wanna be a game programmer? Do you already program? Have you ever programmed for games?
The main advice is to not be concerned about what you get and what you don't get, even if you're a total beginner, you just have to keep on trying things, messing around, see how they work.

You don't need to understand an entire language to mess with some code!

Well, get to it! First off, you need to choose a language! Personally, I recommend ActionScript, Flash, to beginners. There are a lot of sites to host the games, lots of frameworks and tutorials, anyone with an internet browser(and the plugin) can play it.

http://www.adobe.com/devnet/actionscript.html

Right off Google, why not check this little guy out: http://www.emanueleferonato.com/2006/10/29/flash-game-creation-tutorial-part-1/ just to get a hang of how things work, of what programming and ActionScript is. Forget about programming concepts, just mess around, read code, modify it, create something, make things.

Putting your hands to do real work is better than fully learning languages, that's what I believe in. Of course, understanding the language will make you a better programmer.

You can also program games on top of programs and their engines, like GameMaker:

http://en.wikipedia.org/wiki/Game_Maker
Which is good for beginners and there is a lot of community involved around it, so it's good. You need to script a lot of things to make the game work as you want, so you'll learn, but the IDE(Integrated Development Environment) also makes things quite easy. But you should never be afraid to try something new, so it's not good to hang on to Game Maker and running away of getting to know programming languages and frameworks.

You could also program in Unity:
http://unity3d.com/
I don't think Unity's good for beginners at all, and I also think you should take your time with simpler things like 2D games in ActionScript or Gamemaker before falling in to this. But it's powerful if you want to make 3D games fast and you know what you're doing. If you MUST program 3D games, then go for this since the learning curve isn't steep.

To tell you the truth, though, I prefer to program in Java. I'm sure people will point out a lot of things that are wrong with Java and some of them are true, but I enjoy it. However, it's more complicated to program in Java, since it's an object oriented language, so to program well in it, it's best to know some core concepts, so it's definitely not for beginners. I have even programmed games using Swing(you don't know why yet, but it's a bad idea), Java's GUI system(graphical user interface)

The good thing about Java is that it's cross-platform too, anything that has the Java Virtual Machine can run it. After learning some Java you can then start programming for Android (Google's smart phone system), which uses Java too.

So that is pretty much that! Don't be lazy, why not start programming some ActionScript or creating something in GameMaker RIGHT NOW?

If the above text was too confusing, ignore everything and just go here: