将XML文件集成到我的XNA游戏中。 [英] Integrate an XML file into my XNA game.

查看:105
本文介绍了将XML文件集成到我的XNA游戏中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在底部发布了一个示例XML文件,用于我正在设计的Xbox 360游戏。 XML文件旨在被读入,然后在正确输入最后一个组合后,每个组合将显示在屏幕上。每次移动都是一个或多个不同的法术,它们是键盘键。



这是我希望它如何工作:



1.第一个组合显示在屏幕看起来像这样(垂直在屏幕中央):



水1

空气a

地球s

消防



2.如果用户按下正确的键组合(在这种情况下为1 + a + s),下一个组合在屏幕上显示如下:



水1

空气a

地球2

消防n



3.如果用户同时按下正确的键组合(在这种情况下为1 + a + 2 + n),下一个组合在屏幕上显示如下:



水1

空气

地球
消防c



4.如果用户同时按下正确的键组合(在这种情况下为1 + n),则显示下一个组合屏幕,等等。





有谁能告诉我这种工作的例子吗?







示例XML:



I have posted a sample XML file at the bottom for use in an Xbox 360 Game I'm designing. The XML file is intended to be read in and then each combo will be displayed on the screen after the last one is correctly input. Each move is one or more different "spells," which are keyboard keys.

Here's how I would like it to work:

1. The first combo is shown on the screen looking something like this (vertically in the center of screen):

Water 1
Air a
Earth s
Fire

2. If the user presses the correct combination of keys together (in this case 1+a+s), the next combo is shown on the screen like this:

Water 1
Air a
Earth 2
Fire n

3. If the user presses the correct combination of keys together (in this case 1+a+2+n), the next combo is shown on the screen like this:

Water 1
Air
Earth
Fire c

4. If the user presses the correct combination of keys together (in this case 1+n), the next combo is shown on the screen, and so on.


Can anyone show me an example of this type of work?



Sample XML:

<?xml version="1.0" encoding="utf-8"?>
<ComboMove xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<combos>

    <combo>
    <waterSpells>1</waterSpells>
    <airSpells>a</airSpells>
    <earthSpells>s</earthSpells>
    <fireSpells></fireSpells>
    </combo>

    <combo>
      <waterSpells>1</waterSpells>
      <airSpells>a</airSpells>
      <earthSpells>2</earthSpells>
      <fireSpells>n</fireSpells>
    </combo>

    <combo>
      <waterSpells>1</waterSpells>
      <airSpells></airSpells>
      <earthSpells></earthSpells>
      <fireSpells>c</fireSpells>
    </combo>

    <combo>
      <waterSpells>1</waterSpells>
      <airSpells></airSpells>
      <earthSpells></earthSpells>
      <fireSpells>a</fireSpells>
    </combo>

  </combos>

推荐答案

这篇关于将XML文件集成到我的XNA游戏中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆