Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Simple xml parser

Author
Message
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 26th Feb 2012 00:41 Edited at: 26th Feb 2012 00:44
this will show a very simple xml parser just to get you to look at syntax. this is from tiled.
Does not go into graphics it just shows how to get csv format from tiled.

xml part


c++ part


Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 26th Feb 2012 00:45
should output


Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 26th Feb 2012 01:34 Edited at: 26th Feb 2012 01:37
For huge Tiled map you should use the base64 option for datas in tiled. You will save a lot of time while reading file

I've posted Tier1 base64 functions in UCF (for those who are interested)
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 26th Feb 2012 04:41
where did you post your functions mikemax I seem like I can't find them. I want to compare what you did.

Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 26th Feb 2012 10:14 Edited at: 26th Feb 2012 10:18
3d point in space, you've used iostream library. Now that sample will work on Windows only.

That's why it's hard to do that correctly in AppGameKit to have multiplatform-ease, as AGK's reading files commands are poor.

Though, it seems it's not for AppGameKit as you used system("pause") = console app.

Also, you didn't show us rapidxml.h

I guess you are reffering to

http://rapidxml.sourceforge.net/

this library?

Greenster
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: US ©
Posted: 26th Feb 2012 12:38
The smart way to do it is around a t1 regexp function and array, and wrap it with a suite of functions, or even better, use t1 and compiler directives and make a cross-platform class that uses the high level xml apis all the supporting devices have..

This like HTTP is something that should be high priority for mobile market dev tools, since they are after all social devices and not exclusively 2D gaming devices..
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 26th Feb 2012 14:04
UCF functions are for Tier1, not Tier2.

However, here is the base64 encoding/decoding functions :

http://forum.thegamecreators.com/?m=forum_view&t=193433&b=41&msg=2315751#m2315751
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 26th Feb 2012 14:32 Edited at: 26th Feb 2012 14:34
yea i do use iostream but you can use this with agk.
I have done used iostream with mac xcode and with eclipes.

yea this was suppose to get you started with rapid xml, and I am currently building an engine off of this. This is what the engine will have. I was trying to use the simplest example I could make.

in the works.
A function like this.
myengine.map(themap.tmx );

this will load a map.


myengine.centerscreen(position);

this will center map to current player.


myengine.move(player,xdir,ydir)

this will move the player to xdir,ydir


myengine.layer("layer name",type);

this will make a walls that can be collision with.
and type will determine if it is player start point, collidable walls, if it is start point monster, or collectable on the current map.


a function that finds a path between players.

will find the path between two points using the a agorithm

Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 27th Feb 2012 04:56 Edited at: 27th Feb 2012 05:46
This is what I have done with the engine so far

xml cvs.
this returns a vector of <int>'s

xml 64bit
this returns a vector of <int>'s

get the data from a layer
returns a vector of of <int>'s

need to do:
pass the vector to another class to draw it.
example:
myengine->draw(vector<int>,depth);

pass the rotation vector to the class.
0 - means no rotation of current sprite.
1- 90 degree rotation.
2- 180 degree rotation.
3- 270 degree rotation.
example:
myengine->rotate(vector<int> 1st,vector<int> 2nd);

pass the start position from a vector.
example:
myengin->start(xpos,ypos);

Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 27th Feb 2012 05:18
Where can I post what I have done without giving away what I have done with the engine so only good programmers can modify the source.

Developer of Space Chips, pianobasic, and zipzapzoom apps.
Veterian for the military.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Feb 2012 14:06
Quote: "Where can I post what I have done without giving away what I have done with the engine so only good programmers can modify the source."

I would only share what I don't mind anyone using.

Only a good programmer would be able to use someone else's code without really knowing how it works, it's kind of difficult to make something work if you don't understand it and if you do then you're probably a good programmer anyway right ?

Login to post a reply

Server time is: 2024-05-02 09:36:33
Your offset time is: 2024-05-02 09:36:33