• 10
• 12
• 12
• 14
• 16
• entries
271
969
• views
189475

# Progress...

126 views

?????? Gamedev!!

First things first, I got a 3 on my Chemistry AP exam, REJOICE!!! Not bad for a sophmore in highschool[wink].

I actually made a lot of progress today (it's nice for a change). I am really liking the way the engine is falling together. 90% of the things I try and implement I get right the first time with no errors, and the others just take a little longer (except for the mouse cursor code... damn you mouse cursor!!!!). Its odd that 2 days ago I wrote a function that I thought I would never need, and here I am today, using it left and right. Its the little things like that that really make programming fun for me ( that and all the ladies lined up to date me[wink]).

Today I implemented player animation, switches, enemies, and bullets into the engine. Player animation was a snap because I am using one texture to store all of a player's animation(see below) so all I have to do is switch the texture coordinates, and I get some animation going. Here is the template I use to make my textures.

The only bad thing about using one image sheet in OpenGL, is that the textures bleed over the side, and when you are using masking this can raise a bit of a problem, but there has to be a way to solve this, and if anyone knows, please comment or PM me.

The terrain tiles are the same size as the entity tiles, but aren't split up into sections. I think in order to make some animation for the moving terrain (lava, water , blood(eww!!) , etc), I will just mess with the texture coordinates and have the terrain scroll in a direction.

The bullets are just objects that can be tied to a weapon, and when the weapon is fired, the bullets get the type of projectile they are from a function in the weapon class, and then go flying out at the same angle that the player is facing(+ or - a random accuracy factor). The type a bullet recieves dictates other attributes as well, such as splashdamage , splashradius, range , accuracy, etc. Unfortunately, although I have the Shot class written, I cant test it without writing the Weapon class, which should be a lot of fun. The Weapon class will contain data such as Rate of Fire, Magazine Capacity(yes you will have to reload), Accuracy , and type of projectile fired. I cant wait to finish that so that I can start making cool weapons.

Speaking of weapons and ammo, I'm not sure how I'm going to handle picking up ammo in the game. In the game you jump from one point in time to another, and I think that I will have the players original inventory reset every level(because you are starting anew in a different time, which explains how you heal up every new level), and the player will be able to find and use era specific weapons like Ninja Stars, Cannons , and Bats with Nails through them.

The one module that really stands out to me is the Switch class. The switch class contains 7 variables:

x position of switch
y position of switch
x position of target tile
y position of target tile
type of tile to change target to
type of action switch takes
boolean stating if switch has been activated

The switch works by, when activated by the player, changing the tile type of the specified tile into the tile type in the switch object. This can be used to change doors to floors, Water to a Bridge , Lava to Sand, and all this without using a scripting language.

Anyways , here is the screenshot I promised last post:

Well, I better be getting to bed, I've got to get up early tomorrow.

You can fix the texture bleeding problem by setting the wrap mode to clamp to edge

//build the texture object here, glTexImage2D etc...

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );



plus if you arent scaling the textures you may as well use GL_NEAREST for the filtering

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );



You were, or are going to be a sophmore?

-IV

Thanks alot LowCalorie, thats what I was looking for.

I was a sophmore last year when I took the test, but I will be a Junior when school starts again.