Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 14 Sep 2005
Offline Last Active Nov 20 2012 07:02 PM

Posts I've Made

In Topic: How to code bullets in side scroller

10 July 2012 - 08:53 PM

It's because bullet1 is declared locally, resulting in it being in the same spot every time. (Well, that's what it looks like anyway)

I would create a list of bullets and add them as they're fired, update them every frame, and destroy them when no longer needed(ie collision)

In Topic: 2D - "Tileset" index to sub-rectangular position calculation

10 July 2012 - 08:41 PM

More confusion!
[source lang="csharp"]int sy = ((tile_index - 1) / tileset_width);int sx = ((tile_index - 1) - (sy * tileset_width)) * tile_width;sy = sy * tile_height;[/source]

Tile index to source rect Posted Image

In Topic: Loading a tile-maps from text files.

09 July 2012 - 08:22 PM

If you do not need it to be "human-readable", you could just read/write to a binary file...

In Topic: Tile Map - Building ground and houses

04 July 2012 - 04:01 PM

Having a different file for each tile some what defeats the purpose of using a tile-based map, in my opinion.
Why not use a single tileset image and create "objects" to select from, using the tileset?

In Topic: C# AStar

28 June 2012 - 02:50 PM

No no no. I didn't want any one o debug it for me, being this is just learning... just maybe thought someone could see something I couldn't after staring at the darn thing for awhile. But I did figure it out:

[source lang="csharp"]do { if(current_square.tile != 100) { //current_square.tile = 199; path.Add(current_square); current_square = current_square.parent; } }while(current_square.x != start.x && current_square.y != start.y);[/source]


if(current_square.x == start.x)
if(current_square.y == start.y)
return path;

current_square = current_square.parent;

[source lang="csharp"][/source]

And everything is working as it should! Thanks!