5 Replies - 2974 Views - Last Post: 05 December 2017 - 12:24 PM

#1 Garnaal   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 64
  • Joined: 04-September 09

Create sprites from text file

Posted 26 July 2010 - 02:35 PM

Hello,

I have I hope a simple question!
I'm going to create a 2D game in XNA, and for that I would really like that the levels would be .level files (just .txt files renamed to .level)
But I thought about that, and i was wondering if you could create sprites out of that.

so that the S in the piece below would be a sky texture
the B would be a bonus coin or whatever
The G would be a sprite of a ground piece etc etc etc.

this would be the txt file
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

                          B
                                       GGGGGGGGGGG
                                   G   GGGGGGGGGGG
 P                  E     E     E      GGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

*
B = Bonus
E = Enemy
G = Ground piece
P = Player
S = Sky
*



Is This A Good Question/Topic? 0
  • +

Replies To: Create sprites from text file

#2 stayscrisp   User is offline

  • フカユ
  • member icon

Reputation: 1040
  • View blog
  • Posts: 4,325
  • Joined: 14-February 08

Re: Create sprites from text file

Posted 27 July 2010 - 02:42 AM

Yes this is definitely possible, it is known a tiling. You can write a function that creates a tile based on its type and then look through the tiles to draw them. This is also extremely good for collision detection as you can just check if a tile is solid or not and block the movement of a character or enemy.

SixOfEleven has some excellent tutorials on tile-based engines with XNA in game programming tutorials and on his blog.

Hope that helps.
Was This Post Helpful? 1
  • +
  • -

#3 Cryatal   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 21-November 09

Re: Create sprites from text file

Posted 31 July 2010 - 11:02 AM

There is a good tutorial series on xnaresources.com

That helped me when I was trying to do a tile based game.
Was This Post Helpful? 1
  • +
  • -

#4 diliupg   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-January 14

Re: Create sprites from text file

Posted 04 December 2017 - 11:36 PM

View PostCryatal, on 31 July 2010 - 11:02 AM, said:

There is a good tutorial series on xnaresources.com

That helped me when I was trying to do a tile based game.


This link is D E A D ...! ! ! ! ! !
Was This Post Helpful? 0
  • +
  • -

#5 Garnaal   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 64
  • Joined: 04-September 09

Re: Create sprites from text file

Posted 05 December 2017 - 11:59 AM

View Postdiliupg, on 05 December 2017 - 08:36 AM, said:

View PostCryatal, on 31 July 2010 - 11:02 AM, said:

There is a good tutorial series on xnaresources.com

That helped me when I was trying to do a tile based game.


This link is D E A D ...! ! ! ! ! !


The post is more than 7 years old...
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14175
  • View blog
  • Posts: 56,789
  • Joined: 12-June 08

Re: Create sprites from text file

Posted 05 December 2017 - 12:24 PM

This made me laugh. Thanks everyone.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1