Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Monday, 2 May 2016

Music Implementation



On previous projects, the implementation of music has resulted in a staggered opening as the game transitions between scenes. For multiple levels, this is passable as the music would change depending on the environment and situation. However with the cut scene method we are using for this game, given that the free edition of Unity is in use, we are having to use multiple scenes for one conversation. The constant switching of scenes would course a constant loop of just the first few seconds of the music, as appose to one continuous piece. In order to combat this limitation, the audio was attached to a game object that would be called for each scene, until a specific level was loaded. Given that the scene progression is structured in a linear fashion, calling a particular scene for each audio cue was relatively simple, compared to multiple if statements per audio file.

Parallax Scrolling



The notion of adding Parallax scrolling, was appealing from the projects inception. The practice of parallax scrolling adds a sense of depth to the world, as it allows for the background to move along at a separate rate from the character. While the practice has found its way into web design, parallax scrolling first came into use with 2D side scrollers, such as Sonic the Hedgehog, and Street Fight II: The World Warrior. Parallax scrolling is, essentially, an evolution of the scrolling technique found in classic animation from animators like Chuck Jones, Walt Disney and Tex Avery. "Before parallax scrolling, there was simply scrolling. Items in the background moved past at the same pace giving the illusion of motion but not the illusion of space or depth." [AboveTheFold. 2014]. Noticeable examples include The Flinstones and The Jetsons.

- Above The Fold. (2014) The Evolution of Parallax Scrolling. [Online]. Above the Fold. Available From: http://abovethefoldbook.com/the-evolution-of-parallax-scrolling/ [Last Accessed: 02/05/2016]
- Barbera, J & Hanna, W, (1960 - 1966). The Flintstones. Hanna-Barbera Productions. Warner Bros. Television.
- Barera, J & Hanna, W. (1962 - 1963 & 1985 - 1987). The Jetsons. Hanna-Barbera Productions. Warner Bros. Television.
- Brown, J. (2013) What is Parallax Web Design? - Definitions, Tips & Considerations. [Online] August 15th. The Unleashed Blog. Available From: https://www.unleashed-technologies.com/blog/2013/08/15/what-parallax-web-design-%E2%80%93-definitions-tips-considerations [Last Accessed: 02/05/2016]
- Capcom, (1991). Street Fighter II: The World Warrior. [Arcade Cabinet] CP System. Osaka: Capcom Co., Ltd.
- Sega (1991). Sonic The Hedgehog. [Cartridge] Sega Mega Drive. Ota: Sega Co., Ltd.

Tuesday, 26 April 2016

Hit Points and Health.



So far while building, all death and battle mechanics have worked on an 'Instant Kill' rate. Once the player hits the enemy, instant death. While this does work and a game can be built around it, it becomes frustrating in the long run. Implementing a health system allows the player to incorporate more strategic methods of play, as well as providing a wider variety to enemies in terms of strength.

The concept of Health points, or Hit points, can be traced back to the veritable Dungeon & Dragons [Arneson & Gygax, 1974]. Created by Gary Gygax and Dave Arneson, the concept of Hit points was created when porting Gygax's earlier Chainmail [Gygax & Perren, 1971]  rules to the then unfinished Dungeon & Dragons. "It would be Arneson's Blackmoor campaign that first tossed out the "either/or" combat matrix of the original game, adding in innovations such as 'hit points' to determine how wounded a character was and the idea of advancing levels and experience points to indicate growing power." [Rausch. 2004].

- Arneson, D & Gygax, G. [1974] Dungeons & Dragons: Rules for Fantastic Medieval Wargames Campaigns Playable with Paper and Pencil and Miniature Figures. TSR, Inc., Wisconsin.
- Gygax, G & Perren, J. [1971] Chainmail: Rules for Medieval Miniatures. TSR, Inc., Wisconsin.
- Rausch, A. [2004] Dave Arneson Interview. August 19th. [Online]. Gamespy. Available from: http://pc.gamespy.com/articles/540/540395p1.html [Last Accessed: 26/04/16]

Saturday, 27 February 2016

Changing scenes, only a button press away!



While using the free version of Unity is still incredibly versatile, it does have its limitations. Namely  a lack of implementation for cut scenes. While not a necessity in a story driven game, they have become expected, and can provide information and character development in a far more direct manner than mechanics can at times.

Through experimentation, a simple solution was achieved in the manner of single scene shots, with character idle animation in place of full animated cut scenes. 

By adding a new GameObject to the scene and attaching a C# code. Within the code us an update function that runs 'Application.LoadLevel' when 'KeyCode.Space' is inputed. Allowing for the scene to change every time the space bar is pressed.