Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:36:29+00:00 2026-06-09T20:36:29+00:00

I’m going to build an advanced 2D Up-Down RPG. It’ll be a C# +

  • 0

I’m going to build an advanced 2D Up-Down RPG.

It’ll be a C# + XNA version of my existing 2D Flash RPG Engine ( Adobe Air ).

Well, in Flash Pro i’ve simply used different MovieClips for the different Layers but how could i realize that in C# using XNA ?

I want to be able to use the output ( map-data-file ) from the Flash Map Editor I’ve made.

The Output file looks like this:

<layer1>
0.0.0.A.A.A.A.B.B.A.A.0.0.0
0.0.0.A.A.A.A.B.B.B.A.A.0.0
0.0.A.A.A.B.B.B.B.B.B.A.0.0
0.A.A.A.A.B.B.B.B.B.B.A.A.0
0.A.A.A.A.B.B.B.B.B.B.A.A.0
0.A.A.A.A.A.B.B.B.B.B:B.A.0
0.0.A.A.A.A.B.B.B.B.A.A.A.0
0.0.A.A.A.A.A.B.B.A.A.A.0.0
0.0.0.A.A.A.A.B.B.A.A.0.0.0

<layer2>
. . . . . 
. . .
.
.

<layer3>
.
.
.

an so on…

where:

0 = Blank;
A = Gras;
B = Water;

so i want to simply loop through these lines, save in arrays and add the coresponding sprites to the specific layer, maybe like this:

Layers[2].Add( tile, x, y );

how can i realize that ? and also, how can I manage the z-sorting, cuz further i want to be able to walk under bridges, or drive through tunnels.

( like in this image, there could be a ship driving unter the bridge )

enter image description here

or even some stairs to get to the next stage ( switch layer )

do you guys have any idea or even a refference for me ?

thx for all your answers !

EDIT:

the layer hirachy shoult look like this :

map{
    Layer[0] { // "bg"
        xyArray{ .... }
    }
    Layer[1] { // "static" - bottom part / stairs of the bridge
        xyArray{ .... }
    }
    Layer[2] { // "items"
        xyArray{ .... }
    }
    Layer[3] { // "player"
        xyArray{ .... }
    }
    Layer[4] { // "static2" - top part of bridge
        xyArray{ .... }
    }
}

// if the player is ON a tile that hat a Stair funktion, the "player" layer will be
// moved on top of the "static2" layer, so 'Layer[3].Z = 4;' and 'Layer[4].Z = 3;'
// like i showed in the Switch funktion up there
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:36:30+00:00Added an answer on June 9, 2026 at 8:36 pm

    The SpriteBatch.Draw method has overloads that let you specify Layer

    Specifically, the bottom two entries on the table here

    The layer is a float between 0 and 1. You’ll also need to specify a SpriteSortMode in your SpriteBatch.Begin(). Below is an example from a board game I wrote that tints the player tokens and moves the active player to the very front of the stack for when multiple players occupy the same square:

    if (i == currentPlayer)
    {
         SpriteColor = Color.White;
         spriteDepth = 0f; // Front
    }
    else
    {
         SpriteColor = Color.Gray;
         spriteDepth = 0.1f; // Back
    }
    spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
    spriteBatch.Draw(players[i].Sprite, SquareCentre, null, SpriteColor, 0f, SpriteCentre,0.5f, SpriteEffects.None, spriteDepth);
    spriteBatch.End();
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I would like to count the length of a string with PHP. The string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.