Monday, 11 April 2016

Assessment 2: 3 in 1 gaming

Space Invaders clone game


Sprites:

These are the sprites in which I have created for the game. All of the sprites vary in sizes due to the mechanics of the game. For example the spr_earth is very large as it is displayed at the beginning of the game and it covers most of the bottom of the window. The player lives are smaller than the player sprite as they are placed in the bottom left corner of the screen and there are more of the same image of the unicorn than the player.


Sounds:


This screenshot displays all of the sounds in which I have created for the game. There are 4 sound effects and 3 pieces of music altogether. The file names simply explain what they are used for. There are 3 variations to the "Boss Grunt" sound. The reason for this is so that when the player hits the boss with a bullet, the boss doesn't always make the same sound. There are also 3 music tracks which adds variety to the game.

Paths:

There is only one path I have made for this game. The reason behind why I have made this path is so that the boss has an animation. It makes it looks a bit more interesting instead of it just bouncing around the room at the end. The screenshots show what the paths name is and what the path looks like. In the video later on it will show you what the boss looks like when it follows the path.



Objects:

This screenshot displays all of the objects that I have used within my game. The objects with the blank white squares are objects which cannot be seen in game however, they run code in the background which adds lots of features to the game. For example, the controller runs through all of the variables in game which are then used in the other objects, the obj_menu object runs code which brings up the menu in the game, the one you see at the start of the game and the one you see in the pause menu and the obj_starfield object makes the animated background you see appear in every room of the game. This objects adds a nice visual feature to the game.


Obj_Player:

Here is a screenshot of all the events which are contained within the player object. The create event sets out a variable called "bulletdelay" to 0 and "image_speed" to 0.05. The player sprite has a certain number of images in the image index to appear animated in game so this was a suitable speed for the image index to play through. The bulletdelay variable is used in the alarm event. In the alarm event is one line of code which is "bulletdelay = 0". In the space key event is a few lines of code.

Space Key Event

if (keyboard_check_pressed(vk_space) && (bulletdelay = 0)) && (room != menu) then
    {
        instance_create(x,y,obj_player_bullet)
        bulletdelay = 1
        alarm[0] = 30
    }

What this is doing is checking whether the player has pressed the spacebar, the bulletdelay is set to 0 and checking whether they are still in the menu, if they are not in the menu then what happens is a bullet will spawn, then bulletdelay will be changed to 1, acting like a switch, and then an alarm is activated. This alarm is the delay.

Left and Right Key event

if keyboard_check(vk_left) && room != menu
{
x -= 4
}

if keyboard_check(vk_right) && room != menu
{
x += 4
}

This code checks whether the left or right arrow key has been pressed on the keyboard and the player is not on the menu then it either moves to the left at the speed of 4 pixels per script run.

Collision Event (Enemy):

if global.dead = true { 
    lives = -1
    effect_create_above(ef_explosion, x, y, 2, c_red);
    instance_destroy()
    if lives < 0 {
        global.myscore = score
        show_message("You let the asteroids invade Earth!")
        room_goto(hiscore)
    }
}
}  

If the player collides with an enemy (so the enemy has reached near the bottom of the screen) then the player dies. When the player is dead, it creates an explosion effect and takes you to the "hiscore" room.

Collision Event (Bullet):

In this event is a drag and drop "Destroy the instance" with "other" selected. What this does is destroys the obj_bullet.

Collision Event (Wall):

In this event is a drag and drop "Bounce against solid objects". The reason behind why I have done this is so that the obj_player is not able to go through the wall.


Obj_enemy:

Here is a screenshot displaying the events within the enemy object.











Create Event:
In the create event are two actions. The first action is a code action containing:

image_speed = 0.45

if room = menu then {
    global.enemyspeed = 0
    global.enemyshoot = 0
}


If the player is on the menu then the enemy doesn't move or shoot.

The second action is a drag and drop "Start moving in a direction" with the speed being "global.enemyspeed". This variable is a pre-set variable made in the controller event.

Step Event:

if irandom(global.enemyshoot) = 1 && (room != menu) then {
    instance_create(self.x, self.y - 5, obj_bullet)
}

If 1 is chosen out of 2001 (global.enemyshoot for room0 (the first room we go in) and the room is not the menu room then a bullet spawns in where the enemy is.

Collision Event (Wall):

There are two actions within this event, "Reverse horizontal direction" and "Jump to position(0,10). What these do is check to see whether the enemy has made contact with the wall, if it has then it reverses direction horizontally and moves down as it hits the wall.

obj_player_bullet:

Here is a screenshot which displays the 4 events used within the player bullet object. I am going to talk about three of these events fully and the create event briefly. All the create event does is set the vertical speed of the bullet and contains one line of code which tells the game to play a sound when the bullet is shot.



Collision Event (Enemy):

Within the collision event for the enemy are 4 drag and drops, "Set the score relative to 10" which adds 10 score everytime the bullet collides with the enemy, "Destroy the instance" which destroy the player bullet, "Destroy the instance" which destroys the enemy and "Create a firework at (0,0)" which creates and effect in the place where the enemy was destroyed.

Collision Event (MiniBoss):
This collision event is with the mini boss which spawns in the last two rooms before the player is confronted with the main boss. In this event is one action, code.

global.minihealth -= 5
score += 2
instance_destroy()

if global.minihealth <= 0 then
    {
        with obj_miniboss instance_destroy()
    }
   
What this code does is, when the player bullet comes in contact with the miniboss, the miniboss loses 5 health, the player gains 2 points added on to their score and the bullet is destroyed. The if statement checks whether the miniboss health is equal to 0 and if it is then miniboss is destroyed.

Collision Event (Boss):


if global.bossmoving = 1 then {
if irandom(25) = 0 then {
    health -= 10
    score += 15
    instance_destroy()
} else {
    health -= 1
    score += 2
    instance_destroy()
}
} else if global.bossmoving = 0 then {
    instance_destroy()
}

The first if statement checks whether the boss is still following the path made for it previously, if it is then the bullet is just destroyed when it hits the boss without it losing any health. If the boss is not following the path anymore then when the player bullet hits the boss, it has a 1 in 26 chance of a "Critical hit", this dealing 10 damage ( taking 10 health of the boss) and adding 15 score to the players score, every other time the random number chosen is not 0 then when the player bullet hits the boss it deal 1 damage and gives the player 2 score.


var hitsound = irandom(2) // 0, 1 or 2 (3 sounds)

switch(hitsound) {
    case 0:
        audio_play_sound(BossGrunt1, 0, 0)
    break
    case 1:
        audio_play_sound(BossGrunt2, 0, 0)
    break
    case 2:
        audio_play_sound(BossGrunt3, 0, 0)
    break
}

This section of code focuses purely on the sound effects. A random number is chosen, 0, 1 or 2. If the number 1 is chosen, it will go through the switch statement until it reaches case 1, then it will play that sound effect.

Obj_Boss:

Within the boss are 4 events, create, step, collision and an other event. Within the create event are two actions, code and setting a path drag and drop. The code action contains two variables set to 0 and the path drag and drop contains which path is selected for the object to follow and which speed it follows it.  




Step Event:

if global.bossmoving = 1 then {
    if irandom(9) = 1 motion_set(random(360), 1 + random(3))
    if irandom(50/global.runthrough) = 1 then {
        instance_create(self.x, self.y - 5, obj_bullet)
    }
}

If the boss is not following the path anymore then, if 1 is chosen from 0 - 9, the boss has a chance to move in any direction which is chosen randomly from 0 - 360 (in this circumstance would be a full circle) and then the speed is chosen at what rate it moves at by picking a number from 0 to 3. The reason why the "1 +" is put in just before it picks a number is so that if the number chosen was 0 then 1 would be added which means it will always be moving and not stationary. The next if statement decides on when the bullet should be fired. If the number 1 is chosen out of 0 to 50 then it creates a bullet. The global.runthrough is a variable which is used when the player has gone through all the room and defeated the boss and it lets the player go through all the rooms again but is harder. Global.runthrough at first would = 1 and then through the second runthrough it will = 2. With this piece of code above, when it is the second runthrough of the levels, the boss will have double the amount of chance of firing a bullet than before.


Obj_ Controller:

There are 3 events within the controller object. The first event which is the create event contains only one action which is to execute a piece of code.








Create Event:

if room != menu && room != hiscore {
    instance_create(room_width/2, 560, obj_player)
    global.enemyspeed = 0
    global.enemyshoot = 0
}

if room = room0 then {
    global.enemyspeed = 0.5*(global.runthrough)
    global.enemyshoot = 2000 // 1 in 2001 chance to shoot
}

if room = room1 then {
    global.enemyspeed = 1*(global.runthrough)
    global.enemyshoot = 1500 // 1 in 1501 chance to shoot
}
if room = room2 then {
    global.enemyspeed = 1.5*(global.runthrough)
    global.enemyshoot = 1000 // 1 in 1001 chance to shoot
}
if room = room3 then {
    global.enemyspeed = 2*(global.runthrough)
    global.enemyshoot = 750 // 1 in 751 chance to shoot
}


What this large section of code does is decides on how difficult the each room is. You can see that it gets progressively difficult due to the higher the room number the higher the chance it is for the enemy to shoot a bullet. Furthermore, the enemyspeed is increased by the number (for example 1 from room1) times by the global.runthrough (for example, 2nd runthrough = 2), the speed of enemy for room 1 would be then be 2.
Step Event:

if audio_is_playing(InGameMusic) && room = boss then {
    audio_stop_all()
    audio_play_sound(BossMusic, 0, 200)
    audio_sound_gain(BossMusic, global.musicvol, 1)
}

if audio_is_playing(BossMusic) && room != boss then {
    audio_stop_all()
    audio_play_sound(InGameMusic, 0, 200)
    audio_sound_gain(InGameMusic, global.musicvol, 1)
}


This section of code above tells the game when to play a certain music track or not. For example, the first if statement checks to see whether the InGameMusic is playing and checking whether the player is in the boss room. If the player is in the boss room and the InGameMusic is playing then it stops all music together. Then it starts to play the boss music instead. The second if statement follows a similar pattern.

if (instance_exists(obj_miniboss) = 0) && (instance_exists(obj_enemy) = 0) && (room != menu) && (room != boss) && (room != hiscore) then {
    room_goto_next()
}


This next section of code checks to see whether any of the enemies have been left in the room, if some of them are still left and the player is not in the hiscore room, menu or boss room then the player gets automatically moved to the next room.


if keyboard_check_pressed(vk_escape) then {
    instance_create(0, 64, obj_menu)
    audio_stop_all()
    audio_play_sound(MenuMusic, 0, 200)
    audio_sound_gain(MenuMusic, global.musicvol, 400)
    with obj_menu instance_deactivate_all(true)
}

This last section of code checks whether "ESC" has been pressed, if it has then it stops all of the music and then plays the menu music. Furthermore, when the menu is up it deactivates all objects except the menu.

Draw Event:

There are 2 actions within the draw event in the controller, "Draw the lives as image" which displays the amount of lives I want on screen as the spr_lives, "Execute a piece of code" which contains code on the colour of the score font and displays the word "score" in the chosen font.

Hiscore_room:


Here is a screenshot which shows the 3 events contained within the hiscore object. These 3 event help to display the hiscore at the end of the game and saves the previous hiscores obtained by players.







Create Event:

scoredraw = 0
get_string_async("Enter your name...", "Noob")

This section of code brings up the user input box with the message "Enter your name..." and the default text within the input box is "Noob".

Dialog Event:


highscore_add(string(ds_map_find_value(async_load, "result")), global.myscore)

This section of code above is basically saving your score and name.

for (k = 1; k <= 5; k+=1) {
    names[k] = highscore_name(k)
    scores[k] = highscore_value(k)
   
    if (names[k] = "<nobody>") then {
        names[k] = "--"
        scores[k] = "--"
    }
}

scoredraw = 1

This section of code takes what was already saved in the hiscore leaderboards and puts it as a local variable and the last section just replaces the word "nobody" to a "--".


Draw Event:

The draw event in this object contains 3 actions. These 3 actions all work well with one another to display the hiscores in the hiscore room.


Boss Controller:


This object is for the final boss in the last room. It contains 3 events. The create event holds one event which gives the boss a health bar of 100.







Step Event:

if (health <= 0) then {
    with obj_boss instance_destroy()
    room_goto(room0)
    global.runthrough = 2
    global.myscore = score
}


This if statement checks whether the boss health is equal to or less than 0, if it is then the boss is destroyed, the player can run through all the levels again but this time a bit harder. The global.runthrough is now changed to 2 which is like changing the difficulty setting in a game.

Draw Event:

if (global.drawhealth = 1) then {
    draw_healthbar((room_width/2)-256, 50, (room_width/2)+256, 70, health, c_black, c_red, c_green, 180, true, true)
}



All this section of code does is draws the health bar in a certain position in the room and with the colours that I wanted it to use.

Obj_menu:

The object menu has 3 events inside, create, step and draw. Within the Create event is one action, "execute a piece of code".







Create Event:

if room = menu {
    global.play = 0
    global.bulletdelay = 1
    global.options = 0
    global.runthrough = 1
    menuSelPos = 0
    score = 0
    global.myscore = 0
    global.playerspeed = 4
    global.dead = false
    lives = 3
    global.musicvol = 0.5
    drawres = 0
    drawvol = 0
    global.minihealth = 50
} else if room != menu {
    global.bulletdelay = 0
    global.options = 0
    menuSelPos = 0
}

audio_play_sound(MenuMusic, 0, 200)
audio_sound_gain(MenuMusic, global.musicvol, 1)


The reason behind why all the variables are defined within this section is so that, when the player goes through all of the levels again, the variables are not reset. For example; if lives = 3 was actually in room1 and then carried out through all the rooms, when the player goes back to room1 they will have 3 lives again. The audio section at the bottom just simply tells the game to play a certain track when obj_menu is open.
MenuSelPos = The top position. Example; Play or Fullscreen.
Global.runthrough = First runthrough = * 1 , Second runthrough = * 2

Step Event:

if keyboard_check_pressed(vk_up) && menuSelPos > 0 {
    menuSelPos -= 1
} else if keyboard_check_pressed(vk_up) && menuSelPos = 0 {
    menuSelPos = 3
}
if keyboard_check_pressed(vk_down) && menuSelPos < 3 {
    menuSelPos += 1
} else if keyboard_check_pressed(vk_down) && menuSelPos = 3 {
    menuSelPos = 0
}

This section above is how I managed to make the player be able to move the menu selector cursor up and down.

// Menu selections
if global.options = 0 then {
if keyboard_check_pressed(vk_enter) {
switch(menuSelPos) {
    case 0:
        if room = menu then {
            global.play = 1
            audio_sound_gain(MenuMusic, 0, 400) // Fade menu music
            if room != boss then {
                audio_play_sound(InGameMusic, 0, 200)
                audio_sound_gain(InGameMusic, global.musicvol, 1)
            } else if room = boss then {
                audio_play_sound(BossMusic, 0, 200)
                audio_sound_gain(BossMusic, global.musicvol, 1)
            }
            instance_destroy()
        }
    break
    case 1:
        if room != menu then {
            instance_activate_all()
            audio_sound_gain(MenuMusic, 0, 400) // Fade menu music
            if room != boss then {
                audio_play_sound(InGameMusic, 0, 200)
                audio_sound_gain(InGameMusic, global.musicvol, 1)
            } else if room = boss then {
                audio_play_sound(BossMusic, 0, 200)
                audio_sound_gain(BossMusic, global.musicvol, 1)
            }
            instance_destroy()
        }
    break
    case 2:
        global.options = 1
    break
    case 3:
        game_end()
    break
}
}

This section of code above contains a switch statement. The switch statement contains 4 cases, each case represents a section on the menu, Case 0 = play, Case 1 = continue, Case 2 = options and Case 3 = quit. When case 1 is selected then music is stopped and then another music track is played (the in game music track), the second case follows a similar pattern. If Case 2 is chosen then global.options is turned on which is another menu and when Case 3 is chosen then the game stops running.

}
// Menu-Options selections
if global.options = 1 then {
if keyboard_check_pressed(vk_enter) {
switch(menuSelPos) {
    case 0:
        if window_get_fullscreen() = true then {
            window_set_fullscreen(false)
        } else {
            window_set_fullscreen(true)
        }
    break
    case 3:
        global.options = 0
    break
}
}
switch(menuSelPos) {
    case 0:
        drawres = 0
        drawvol = 0
    break
    case 1:
        drawres = 1
        drawvol = 0
        if keyboard_check_pressed(vk_right)
    break
    case 2:
        drawres = 0
        drawvol = 1
        if keyboard_check_pressed(vk_right) && audio_get_master_gain(0) < 1 {
            audio_set_master_gain(0, audio_get_master_gain(0) + 0.1)
        }
        if keyboard_check_pressed(vk_left) && audio_get_master_gain(0) > 0 {
            audio_set_master_gain(0, audio_get_master_gain(0) - 0.1)
        }
    break
    case 3:
        drawres = 0
        drawvol = 0
    break
}
}

This last section of the code is another switch statement similar to the one further above. It contains cases in which allows the player to choose what they want. However, with this options menu, the code contains 2 switch statements but they are the same. One switch statement requires you to press enter which is the first switch statement for Case 1 (Which is allowing the player to select fullscreen when pressing enter). Then the second switch statement is a switch statement which doesn't allow you to press enter on any of options (you don't need to press enter to access any of the cases). The only case which does something in the second switch statement is 2. What this section of code lets the player do is, when they press left or right on the keyboard, the volume either decreases or increases in volume, 0.1 = 10% and 1 = 100%.


Draw Event:

For the draw event, it contains two 1D arrays. The first 1D array is for the main menu and the 2nd 1D array is for the option menu. The rest of the code which is contained within the draw event is deciding on what colour font the words are going to be in the menu. The colours are either white or grey, grey meaning they cannot be used.


Rooms:


Here are the rooms in which I have created for the game. There are 4 rooms which contain the smaller enemies and mini boss then there is a boss/final room. Once the player has defeated the final boss they are able to go back through the levels again at a higher difficulty. The hiscore and menu rooms are bonus rooms to the game.






































Monday, 14 March 2016

Unit 13: Assignment 3 (Finished)



Mortal Kombat X is a game which involves two characters which essentially fight to the death. You use a combination of moves to take out the other opponent. However, towards the end of the fight, you can perform a fatality or a brutality move. There is a story mode for this however, it is not as long as Mortal Kombat 9 and it is the only way to unlock a certain character. There are 12 chapters in this story and quick-time events. These quick time events are events which involve the player pushing a button which appears on screen. If this player misses the once chance to press the button then it may have an impact on the story. There are also tower modes in this game in which can be played in co-op mode. Mortal Kombat X is best known for its graphical brutalities and fatalities. This game is available on the PS4, Xbox One, PC, IOS and Android devices. There are quite a few newspaper reports on whether this game may be the most violent video game ever or just too violent with the brutalities/fatalities. At this moment in time, the current media hype for this game has a mixed reaction. A new DLC is soon to be released for the consoles which is called Mortal Kombat XL which contains new content, characters and much more. They must have licensed the new characters for the game DLC such as "Jason Voorhees" from Friday the 13th, "Leatherface" from Texas Chainsaw Massacre and "Alien" from the Alien film series as these characters have already been previously used in films. If they have not, well there will be a copyright issue for them in store (clearly they have but this is just a circumstance if they have not). This has created a positive buzz for the console owners, however, for the PC gamers, negativity has risen. Warner Brothers has announced that the new DLC content and future support has stopped for the PC port of the game. Below is a link and images in which shows evidence of how people have responded to Warner Brothers choice on releasing the DLC for console only. I believe that this was a rough move made by Warner Brothers and the game company NetherRealm studios as this will pull down the sales on the major gaming platform, PC. Furthermore, with the decision firmly made for the DLC not to be released on PC, this has put many players off from buying any further games produced by the game company and published by Warner Brothers.  The price of the game for the PC is lower than the price for the consoles.

http://www.eurogamer.net/articles/2016-01-21-warner-accused-of-abandoning-mortal-kombat-x-pc-players




Mortal Kombat X is the tenth instalment of the Mortal Kombat series and it is accordingly the best selling fighting game in the history of the gaming industry. The Mortal Kombat series overall has now sold over 35 million units since its debut in the 90's. Furthermore, Mortal Kombat X is in the top ten of the best selling games in 2015, just as fortune.com says "violence sells".
The graphic violence in this game however has concerned the public. News articles say that Mortal Kombat X may be too violent for gamers and ever returning fans. As technology has advanced, graphics for photo-realistic games have got better. This game has took the advantages of the better graphics and have made brutalities and fatalities, gory and graphic. This article contains a video which displays the review of some of the fans watching the brutalities/fatalities which the characters perform.

http://www.cbc.ca/news/technology/mortal-kombat-x-s-graphic-fatalities-may-be-too-violent-for-some-fans-1.3027034

As the above link shows an article questioning whether the fatalities in game may be too violent, the link below contains a video in which shows some of the new fatalities and brutalities played by the character "Leatherface" which is going to be released in the new DLC Mortal Kombat XL/ Kombat pack 2. As a gamer I believe that this fatalities and brutalities are very fitting for the game, however they are very gruesome and can make people feel uncomfortable.

http://uk.ign.com/videos/2016/02/29/mortal-kombat-x-every-leatherface-fatality-x-ray-and-brutality-in-1080p-60fps

The cultural impact of the game overall is huge in the gaming industry and social culture. In 2012, John Tobias said: "If you look at any other pop culture phenomenon—like if you look at the Teenage Mutant Ninja Turtles, for instance—it became popular at the time right around when Mortal Kombat became popular, and it had its highs and lows, and here they are once again talking about a major motion picture. That’s because of its place in pop culture. It’s always there for someone to pick up, polish off, blow the dust off of it, and re-release it. And Mortal Kombat will always be that way. It’ll be around 50 years from now."
http://gameological.com/2012/10/interview-mortal-kombat-cocreator-john-tobias/

In the 1990's "waves of imitators began to flood the market, filling arcades with a sea of blood". It has been said that the Mortal Kombat series had unearthed an era of exploitation games, fighting games, games in which contain blood and gore, however, due to the blood and gore in the Mortal Kombat series, it has appeared in many court cases . For 18 years, people in Australia have been trying to get Mortal Kombat banned. Australian censors refused classification for the game in which banned the series overall.
http://www.news.com.au/technology/home-entertainment/it-took-18-years-but-mortal-kombat-is-finally-banned/story-e6frfrt9-1226014699735

In 1998 there was a bill to regulate video game violence which was sponsored by Barry Silver as it "has affected the moral fiber of our youth". Below is some evidence on the game having effect on the younger generation. There was a case of the game being responsible for a death of a 7 year old called Zoe Garcia. The 7 year old girl was being babysat by Heather Trujillo and her boyfriend Lamar Roberts. Both of them were charged with child abuse. It was said in a report that they were both using Mortal Kombat moves on Zoe Garcia in December 2007.
http://kotaku.com/5021628/one-mortal-kombat-killer-avoids-prison-term


Back in may 29th 1995, there was a newspaper article about women being put in Mortal Kombat. People believed that this was a bad move for them to put females in a violent game. Quoted by "kinder" Mortal Kombat 2 shows some "of the most violent possibilities are against women", meaning that the moves performed on the female characters are the most violent ones in game.  It is said that the fatalities in which the female characters performed were "highly eroticized". Following on from the characters moves being highly eroticized, the artists were sent back to reinvent the clothes for the female characters as they were apparently "not as clothed as they should have been". In defense of this publication, Michaelene Christini Risley, group director in charge of licensing and character development of Sega of America stated that the game is "not the real world" and that "videos games are about entertainment".
https://news.google.com/newspapers?nid=1683&dat=19950529&id=BKMaAAAAIBAJ&sjid=7CwEAAAAIBAJ&pg=2542,4532180&hl=en



The violence within the game isn't the only problem in this equation. Another problem with the game which has been publicly spoken about is the release of this game for the older generation consoles, PlayStation 3 and Xbox 360. It was announced that the game was going to be released on all platforms, including the two older generation consoles, however, when it came to pre-ordering the game, fans was looking forward to the game being released on June 30th 2015. It was then later announced that the game was going to be released in the fall of 2015 so fans were unsure of when the game was going to be released. The release date was pushed forward to the 31st of December 2015 as even game shops were unsure on the release. Further on in the year, it was then announced that the game was cancelled for the older generation consoles.

Old release date
New release date


The Mortal Kombat series is known for the reason behind why age ratings was introduced in the gaming industry. The ELSPA rated Mortal Kombat as Mature, in which meaning it was for 17+. Then the PEGI ratings were introduced in 2003, the PEGI rating is most commonly used on games instead of the ELSPA. Below are two screenshots which display the age rating for Mortal Kombat X on PS4 and Xbox One.

18
Game contains bad language  Game contains depictions of violence Game can be played online
  Mortal Kombat X 
    Warner Brothers Entertainment UK Ltd
 The content of this game is suitable for persons aged 18 years and over only.
It contains: Extreme violence - Violence towards defenceless people - Strong language
This game allows the player to interact with other players ONLINE
System: PlayStation 4
Genre: Action
Releasedate: 2015-04-14
18
Game contains bad language  Game contains depictions of violence  Game can be played online
 Mortal Kombat X 
 Warner Brothers Entertainment UK Ltd
The content of this game is suitable for persons aged 18 years and over only.
  It contains: Extreme violence - Violence towards defenceless people - Strong      language
  This game allows the player to interact with other players ONLINE
System: Xbox One
Genre: Action
Releasedate: 2015-04-14










Mortal Kombat X didn't only receive negative feedback from fans and the media. The game won the title of "Best fighting game" from The Game Awards 2015 and it was in the top 10 of best selling games in 2015. Mortal Kombat X is the fast selling game of the series and when it was released, it was one of the UK's second fastest selling release games in 2015.  The fact they have the game available on so many different platforms adds to their sales in which made the game the fast selling game of it series. [1] Furthermore, a lot of fans have been very excited for the long anticipated DLC which has been released. What makes the game good is that is was one of first to put on the newer generation consoles and the fact it has taken advantage of the graphics excellently. This game also has a ESL Pro League tournament in which fans can battle it out with one another in game to win a cash prize.  This creates a lot of hype for the game as returning fans will want to participate and watch the battles carry out. This also gives fans an opportunity to cosplay as characters within the game. [2]

Early rating on the game (just after release) are:

80/100 from Gamertime
"The superior display of NetherRealm Studio proves that the "king" is back and he is here to stay"

9/10 from Thisgengaming
"I thought it would be hard to top Mortal Kombat 9" but Netherrealm Studio's proved me wrong with this excellent game"

4/5 from PC gaming forum
"The presentation is great with nice slick UI and a good movie-like campaign"


Personally, I think this game is great. I have played this game on the PC and on Xbox One and i have found this game very enjoyable yet rage-worthy. I play this game with my friends as i find it is most fun to play that way. The "test your might" tower mode in this, I played against my friend and i found it very competitively fun. The difficulty level of the tower makes me want to go back and keep trying until I defeat the tower. When it comes to the fight in general, the graphics are excellent and performing fatalities (for me) is an added bonus onto my boasting rights for winning the match.

http://venturebeat.com/2016/01/14/2015-npd-the-10-best-selling-games-of-the-year/ [1]

http://en.pro.eslgaming.com/mkx/proleague/ [2]

http://www.lazygamer.net/gaming-news/xbox/xbox-one/early-mortal-kombat-x-reviews-positive/ [3]

Thursday, 25 February 2016

BlackJack: 3 in one gaming assessment




Assessment 2: 3 in one gaming


Sprites:

Deck (spr_deck)
Contains all of the cards sprites.
Deal Button (spr_dealbutton)
Used to deal the cards.

Twist (spr_twist_button)
Used to allow the player to spawn a card.
Stick (spr_stick_button)
Allows the player to pass the turn.
Restart (spr_restart) 
The restart button was there so that I could restart the game to check if everything was working each time I played. 

Objects:

Controller (controller)
Player (obj_player)

AI1 (obj_AI1)
AI2 (obj_AI2)
Dealer (obj_dealer)
Deck (obj_deck)
Twist (obj_twist)
Stick (obj_stick)

Controller:
(Create Event):
Contains and initialises all of the global variables which are used in game. It also contains code for the ini file. The ini file code is:

ini_open("scores.sav")   (Doesn't create it, gets it ready)


if !(ini_key_exists("player", "wins")) then {              
     ini_write_real("player", "wins", 0)
}

ini_close()

If there isn't "player" and "wins" there then create it in the ini file "scores.sav" and the ini_close, closes the file it has been written/checked its been written.




(Step Event):
In the step event of the controller contains code which checks whether all the players have hit more than 21. When it checks through each if statement, its checking to see whether the player is over 21, and if they are, the global.turn changes to 1000. The reason behind why it changes to 1000 because is so it is a value which I know I won't use to activate anything important. The global.turnTo is a variable which is used to change who's turn it is. When it changes integer, that when it is the next person/AI turn.

(Draw Event):
The code within the draw event is just repeated code. The main mechanism behind it is, if the variable "finish"is 0, which is the state where the game is in play, then it checks to see whether the value of their cards added up is over 21. If they are over 21, (which in the step event, if they are over 21 it switches to 1000) then it activates the else statement and displays the word "bust".
This code is repeated for all of the AIs as they use similar coding.

Further down is the code in which displays whether the players have won or the dealer has won. The code is repeated for the AIs as they use similar code. So the first part of the code is checking whether the game has finished, if it is equal to 1 then the game has finished. Then it checks whether the playervalue is NOT 1000 and the player cards value is  more or equal to the dealers card value or dealers value is equal to 1000 then the player wins and it displays the words "You won!". Additionally, it opens the ini file, reads the current amount of wins, then the next part which is "if global.save = 0 then...." this section checks whether a new score needs to be saved and then adds 1 if the player has won. Within this global.saved if statement, it will read the ini file and display the current amount of wins when you have won. The else statement checks whether the cards value in hand = 1000 or the playervalue is less than the dealers then it will say the player has lost.
The dealer code for this is different. The wins don't get saved when the dealer wins. What happens is, when the dealer value is not a 1000 (a value which is used generically) it displays the current card value in the dealers hand, else when the dealer value is 1000 then the total display changes to "bust".




(press F key Event)
This event comes into play when the player wants to access full screen mode. The screenstate is setting acts as an on and off switch for when activating the full screen mode.







obj_player:
There is not much code in the player object as a lot of the mechanisms for the player have already been predefined in the controller object.

(Create Event): (similar coding for all AI/Dealer)

Depth = -global.player_card_xpos - this piece of code defines where the placement of the cards of going.

global.player_card_xpos += 80 - This adds 80 pixels onto where the previous card has been displayed and then places a new a card.

image_speed = 0 - We want the card to not cycle through all the image index so we have it set to 0.

image_index = ds_list_find_value(global.deck,0) - Sets the image index to the values in the ds list.

cardValue = ds_list_find_value(global.deck,0) - Finds the value chosen for that card.

ds_list_delete(global.deck,0) - Removes the selected card from the ds_list deck.




obj_dealer:
(Create Event):
Similar code to player, just different variables used.





(Alarm 0):
There are only two lines of code within this event.

global.turn = 3 - This line of code is a variable change so it can activate another persons turn.

show_debug_message("Alarm countdown works333") - This allows me to see if the alarm has worked by showing a debug a message.





(Step Event):
The step event contains 3 if statements (one nested).

if global.turnTo = 3 then {
    show_debug_message("Alarm works3333")
    alarm[0] = 100
    global.turnTo = 1000
}

This first section above is checking whether the turnTo variable is 3. Once it is 3, the alarm will activate and then the turnTo variable is set to the common number of 1000, one we don't use to activate anything.

if global.turn = 3 then {
    if global.DealerValue < 17 then {
        instance_create(global.dealer_card_xpos, 145, obj_dealer)
        global.turn = 1000
        global.turnTo = 3
    }

    if global.DealerValue >= 17 then {
        global.turn = 1000
        global.turnTo = 1000
        global.finish = 1
    }
}


This second section checks whether the variable "turn" has changed to 3 (in which is has because of the alarm event) activates the nested if statement. The nested if statement checks whether the dealers overall cards in hand are less than 17 then it will automatically produce another card for the dealer.
If it is more than 17, the dealer is not allowed anymore cards.



obj_AI1/obj_AI2:
(Create Event):
The create event uses similar code to the dealer and player object, the only difference is the variables used. 






(Alarm Event):
The alarm event uses similar code to the dealer and player object alarm events, the only difference is what the variables are equal to.





(Step Event):
The step event is the event which holds the probability code.  I am going to break this code into sections and explain what this does.

if global.turn = 1 then {
    if global.AI1Value = 21 then {
        global.turn = 1000
        global.turnTo = 2
        exit

    }

This small section defines whether the AI has definitely hit 21 or not. If they have definitely got 21 then the turns have to increment by one. 

if global.AI1Value < 16 then {
        instance_create(global.AI1_card_xpos, 457.5, obj_AI1)
        show_debug_message("AI1 Value less than 16 therefore card")
        global.turn = 1000
        global.turnTo = 1

  

This section is the first third of the probability code used. This is checking whether the cards in hand for AI1 is less than 16, if so a card will definitely spawn in for them and add on to the current overall value. (The turn and turnTo variables are there just to make sure the turn doesn't change). 

} else if global.AI1Value >= 16 then {
        if irandom(global.AI1Value - 16) = 0 then {
            instance_create(global.AI1_card_xpos, 457.5, obj_AI1)
            show_debug_message("AI1 Value greater than 16 therefore probs card")
            global.turn = 1000
            global.turnTo = 1

            exit

This is the second third of the probability code used. If the current cards in hand for AI1 add up to more than 16 or is 16 then an if statement is carried out. The irandom is used so that it picks a random number between whatever the current value in hand is - 16 and 0. For example, if the AI1 cards add up to 18, then it run through the code, minus 16 from 18 (which leaves 2) and picks the number 2, 1 or 0. If the number is 0 then it will spawn in another card, keep the turn as 1 (which allows it to take another go) and runs through the code again.

  } else {
            global.turn = 1000
            global.turnTo = 2
            show_debug_message("AI1 Value greater than 16 therefore probs no card")
            exit
        }
    }
}

This is the last third of the probability code used. If the irandom number chosen is not 0 then the turn goes to the next player and a debug message is shown, allowing me to check that the turn has definitely been passed on.




obj_deck:
(Create event):

global.deck = ds_list_create()
for(k = 0; k < 52; k += 1) {
    ds_list_add(global.deck, k)
}
randomize()
ds_list_shuffle(global.deck)

The "randomize" code randomises the random seed every time, so that when the deck shuffles, it will not have the same shuffle every time.
This section of code create the ds_list which is used for deck.
What the ds_list looks like right now is:

index: 0 1 2 3 4 5 6 7 8 9 10 ...
value: 1 2 3 4 5 6 7 8 9 10 11...

The index is the location, where the values are stored.

global.deckValue = ds_list_create()
for(k = 2; k < 11; k += 1) {
    ds_list_add(global.deckValue, k)
}
ds_list_add(global.deckValue, 10)
ds_list_add(global.deckValue, 10)
ds_list_add(global.deckValue, 10)
ds_list_add(global.deckValue, 1)

The section of code is where i add the values to the card deck. Where "k" is equal 2 and is less than 11, this is where the value will align with the index numbers. The increment of 1 makes sure that the values will definitely go up by one.  It will look a little like this;

index: 0 1 2 3 4 5 6 7 8
value: 2 3 4 5 6 7 8 9 10

The ds_list_add section adds the numbers 10 3 times and 1 for the Jack, Queen, King and Ace after the value numbers 2-10. So now the value will look like:

index: 0 1 2 3 4 5 6 7   8   9  10 11 12 13
value: 2 3 4 5 6 7 8 9 10 10 10 10 1

This now covers a whole suit of cards. This first suit of cards is most likely spades as that is the first suit seen in the image index. This section of code is repeated another 3 times for the other 3 suits.




(Left button event):

if mouse_check_button_pressed(mb_left) && global.dealDone = 0 {
// Deal button event

instance_create(global.dealer_card_xpos, 145, obj_dealer)
instance_create(global.dealer_card_xpos, 145, obj_dealer)
instance_create(global.player_card_xpos, 745, obj_player)
instance_create(global.player_card_xpos, 745, obj_player)
instance_create(global.AI1_card_xpos, 457.5, obj_AI1)
instance_create(global.AI1_card_xpos, 457.5, obj_AI1)
instance_create(global.AI2_card_xpos, 457.5, obj_AI2)
instance_create(global.AI2_card_xpos, 457.5, obj_AI2)
global.turn = 0
global.dealDone = 1
exit
}

if mouse_check_button_pressed(mb_left) && global.dealDone = 1 {
game_restart()
exit
}

This code is fairly simple, what happens is when the player left clicks on the card deal sprite, it will instantly deal the cards to the desired positions. Then the turn is set to 0 which means the first player can take their turn and dealDone is a variable used to make sure that the deal has been successful.
The bottom if statement checks whether the left button has been pressed over the sprite and checks if the deal was successful and then the game will restart.



obj_twist:
(Left button event):

if mouse_check_button_pressed(mb_left) {
    switch(global.turn) {
    case 0:
        instance_create(global.player_card_xpos, 745, obj_player)
    break
    case 1:
    show_message("You must wait for Player 1 to end their turn")
    break
    case 2:
    show_message("You must wait for Player 2 to end their turn")
    break
    }
}

When the left button is pressed, the player is able to add another card to their hand of cards to get close to the objective of the game, getting "blackjack"/21. If the player becomes bust or tries to use the twist button whilst it is someone else turns, a message will pop up dependent on which global.turn it is on. If the turn is on 0 then the player is still able to take their turn.



obj_stick:
(Left button event):

if mouse_check_button_pressed(mb_left) {
    switch(global.turn) {
    case 0:
        global.turnTo = 1
        global.turn = 1000
    break
    case 1:
    show_message("You must wait for Player 1 to end their turn")
    break
    case 2:
    show_message("You must wait for Player 2 to end their turn")
    break
    }
}

The code used for the stick button is very similar to the twist button. The code uses a switch statement instead of a bunch of if statements as it is easier and tidier to use. If the turn is on 0 and the player clicks on "stick" then the turnTo is activated and activates code for the AI player and your turn is over.



Sound:
I only have one sound for this game which is used for when the cards have been dealt. This sound lasts for a few seconds. The only reason why I only have one sound is because I have mainly been focusing on the coding for the game to make sure that everything works in harmony with one another. The sound code will be shown in a testing video (done by me) showing what sound I chose and showing it working.

Management:


Testing: 

Luke Anderson: The game was good with the dealing and the AI but I was able to restart the game when ever I want.

{The image below displays him typing up his thoughts on the game into my blogger.}




{The image below displays his game play when he pressed the deal button (back of card)}



{The image below displays his game play, after he has taken his turn and the AI's have taken their turn}


The reason behind why it says he has won "3" times is because that is how many times he has won on this computer.

Morgan Proffitt:

https://www.youtube.com/watch?v=GyccyeSxVM0&feature=youtu.be





Me:

https://www.youtube.com/watch?v=hr4fJiuUgRI&feature=youtu.be