zondag 7 maart 2010

07/03/2010: Level mechanism & Path slopes

Saturday I had an interesting course given by Pieter: Two topics were discussed:
  • ActionScript 3: until now, we used the ActionScript 2 language. However, ActionScript 3 seems the way to go if you start developing Flash games. Version 3 is a language that is more object oriented (and less forgiving). Also, we used the Eclipse-based Flex Builder 3 development environment. I like it!
  • Physics engines: wow, a physics engine is really cool. You just have to configure a world with objects that can collide and some forces (eg. gravity) and the engine computes everything for you. I like it too!
Back to XNA: I finished another refactor: level support has been built in. Currently, I have a LevelManager class that reads an XML file with level information. The LevelManager creates Levels based on the XML configuration and .NET reflection. This had some impact on the existing code structure; but it was worth to do it.

Next, I developed functionality to compute the slope (angle alpha) of a part of the path. This slope influences the speed at which Simon moves. A positive slope will decrease speed, a negative slope will increase speed.

Some basic trigonmetry formulas and Pythagoras helped me with this. It seems that one cannot do without in game development :)

For the curious, alpha = sin-inverse( B / (sqrt(B^2 + C^2))).

Geen opmerkingen:

Een reactie posten

Volgers