The random rantings of a concerned programmer.

Archive for June, 2005

4E4: holy crap!

June 29th, 2005 | Category: Uncategorized

Well, I made that “Post Yer Screenshots” thread to get a peek at what everyone else has done so far.

AND HOLY CRAP! There are some insane things already in the works. I can’t wait for the contest to finish so I can see all these games in action – the competition is proving to be pretty fierce.

If you have screenshots from your 4E4 entry and have yet to share them, please post in that thread! I want to see the uber awesomeness that everyone else is making ^_^

Now my stuff really looks like crap

2 comments

hitlar!

June 28th, 2005 | Category: Uncategorized

(Untitled)

June 28th, 2005 | Category: Uncategorized

Might as well post a class I wrote today (pseudocode)

struct cUnitType {
	///////////
	// STATS //
	///////////

	int stat_maxHP;

	struct cAttack {
		int m_Power, m_RangeMin, m_RangeMax, m_Accuracy; 
	} stat_Attack1, stat_Attack2;

	int stat_Armor,   stat_RArmor;
	int stat_Evasion, stat_Stealth;
	int stat_Speed,   stat_LOD;
	int stat_MaxGarrison;

	std::vector<cUnitType*> stat_Buildables;

	////////////////////
	// ANIMATION DATA //
	////////////////////

	// Struct to store each animation.
	struct cAnimation {
		std::string  ID;        // animation ID.
		cSDLSurface* surf;      // surface which contains the animation

		// Struct which contains the frames for an orientation
		struct cOrien {
		
			// Struct to store each frame
			struct cFrame {
				int t_x; int t_y;   // Texture coordinates XY
				int t_w; int t_h;   // Texture dimensions

				int m_Duration;     // time duration of the frame
			};
	
			ORIENTATION         m_Facing; // the orientation
			std::vector<cFrame> m_Frames; // frame data
		};

		// vector to hold all of the different orientations of the animation
		std::vector<cOrien> m_Orientations;
	};

	// vector which holds all the animations for the unit.
	std::vector<cAnimation>;
};

Just to prove I am still working.

Comments are off for this post

4E4RTS: Spriting

June 28th, 2005 | Category: Uncategorized

Attempted to make a rice field sprite, as suggested:

It came out okay, I think. I’ll let you decide. It kind of needs to be bigger.

4 comments

4E4RTS: Coding gone wrong

June 28th, 2005 | Category: Uncategorized

Okay, I’m running into some problems with this newly refactored map class; well, its pretty much the optimized render function.

I’m banging my head against a cement wall as I’m writing this

virtual void render(SDL_Surface* screen) {
	for(int offsetX = (int)(m_offX / m_Objs.begin()->t_w); offsetX*m_Objs.begin()->t_w < m_cullX; offsetX++) {
		if (offsetX > m_rows || offsetX < 0) continue;
			
		for (int offsetY = (int)(m_offY / m_Objs.begin()->t_h); offsetY*m_Objs.begin()->t_h < m_cullY; offsetY++) {

			if (offsetY > m_TileAtY || offsetY < 0) continue;

			std::vector<cTile>::iterator i = &m_Objs[offsetY*m_rows+offsetX];			

			desRect.x = offsetX * m_Objs.begin()->t_w + m_offX;
			desRect.y = offsetY * m_Objs.begin()->t_h + m_offY;
				
			srcRect.x = i->t_x; srcRect.y = i->t_y;
			srcRect.w = i->t_w; srcRect.h = i->t_h;
			SDL_BlitSurface(i->surf->surf,&srcRect,screen,&desRect);
		}
	}
}


Funnily enough, its doing weird stuff with the culling. As in, not what its supposed to be doing. Still trying to figure out what the hell I did last night. Grrr….

3 comments

Next Page »