Ok time to start this contest.
What you have to do is create a Read/Write XML game config. Your game has to be able to read and write to an XML wiht out using any external program to create the config file.
Examples of what it could do are things like save, load, sound, and graphics adjustments.
It is ok to use IrrXML to boost the development time.
Your game dosn't have to be anything more then a blue screen and a model to show how your XML file works.
All code must be well commented.
C/C++/C# or anyother .NET language only please.
We will judge by how clean the code is, how well it works, and how many features it has.
Good luck!
and Have fun!
Intermediate Challenge - Read/Write XML Config. For Game!
-
- Posts: 448
- Joined: Tue Oct 05, 2004 3:24 am
- Location: Boston, MA
Intermediate Challenge - Read/Write XML Config. For Game!
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
Learn the basics at </dream.in.code>
-
- Posts: 448
- Joined: Tue Oct 05, 2004 3:24 am
- Location: Boston, MA
Yes really, All projects must be in by August 31st, 2006. Please send them to:
joliveri@h4games.com
Good luck to all!
joliveri@h4games.com
Good luck to all!
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
Learn the basics at </dream.in.code>
**EDIT**
Whoops, I see the due date was 31st August. rofl - oh well.
-----------
Well, if you include .NET, here is my answer in VB.NET. Although, I would say that .NET is kinda cheating for XML, haha.
And here is what the actual settings file looks like:
Nice XML hey? So easy in .NET.
So, do I win?
Whoops, I see the due date was 31st August. rofl - oh well.
-----------
Well, if you include .NET, here is my answer in VB.NET. Although, I would say that .NET is kinda cheating for XML, haha.
Code: Select all
Imports System.Xml.Serialization
Public Class Game
Private Sub Game_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim GS As New GameSettings
GS.KeyboardDelay = 30
GS.PlayerName = "Sgt_Pinky_R0X0rz"
GS.MouseSensitivity = 10
GS.KeyMap = New Integer() {123, 152, 155}
'save settings
Dim xszSer As XmlSerializer = New XmlSerializer(GetType(GameSettings))
Dim xmlWriter As Xml.XmlTextWriter = New Xml.XmlTextWriter("c:\gamesettings.xml", System.Text.Encoding.UTF8)
xmlWriter.Formatting = Xml.Formatting.Indented
xszSer.Serialize(xmlWriter, GS)
xmlWriter.Close()
'load settings
Dim GSLoad As New GameSettings
Dim xmlReader As Xml.XmlTextReader = New Xml.XmlTextReader("c:\gamesettings.xml")
GSLoad = xszSer.Deserialize(xmlReader)
xmlReader.Close()
End Sub
End Class
<Serializable()> _
Public Class GameSettings
Public PlayerName As String
Public KeyMap() As Integer
Public MouseSensitivity As Int16
Public KeyboardDelay As Int16
End Class
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<GameSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PlayerName>Sgt_Pinky_R0X0rz</PlayerName>
<KeyMap>
<int>123</int>
<int>152</int>
<int>155</int>
</KeyMap>
<MouseSensitivity>10</MouseSensitivity>
<KeyboardDelay>30</KeyboardDelay>
</GameSettings>
So, do I win?
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
#irrlicht on irc.freenode.net