Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Water is a renewable resource!

Sign in to follow this  


Well, the spikes work now, so I can get to work on the other special tiles. These include:

- Ladders
- Water
- Checkpoints
- Teleporters
- Item boxes (think mario)

There will probably be more, I just haven't thought of them yet.

I'll probably try to get ladders working tomorrow, and possibly try water. Water is going to be tricky to make.

It's not making the player control differently when they're in water. Actually, that's the easy part. It's making the player drawn differently. The water itself will be drawn with an alpha value, so that it is semi transparent. However, I already realize there will be a problem drawing the player when he jumps into water. When the player will be drawn in water, it won't look like it's in water, because the player sprite is automatically drawn over any tile sprites. The tricky part will be making it appear as if the player is in the water.


On something totally unrelated, playing around with Civilization 4 modding:
Screenshot 1
Screenshot 2
Sign in to follow this  


Recommended Comments

Perhaps you should give the tiles their own "z" value, this could be as simple as -1 being behind the player, and 1 being on top of the player. Then you could just iterate through your tile's twice, first rendering tiles with negative z's, then render the player, then render tiles with positive z's.

Of course if you are using DX or OGL, you could just use the depth buffer, but IIRC you are using SDL, so disregard that.

Share this comment

Link to comment
Original post by Stompy9999
The tricky part will be making it appear as if the player is in the water.

If the player is over a 'water' tile, set a flag to let your rendering code know to render the player BEFORE the maptiles are drawn. Or draw a secondary copy of the player sprite(s) with a premade water-alpha-ish overlay.

Share this comment

Link to comment
Yep, that sounds like the most logical thing to do.

I probably should have had that in the tile engine to begin with. With that, I could also use it on other tiles to add to the semi-3D effect I've been trying to achieve.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!