Hey there! Sign in to join this conversationNew here? Join for free

GCSE Computing Help - Visual Studio 2015 Console Application Watch

    • Thread Starter
    Offline

    7
    ReputationRep:
    I have to create a game with lots of different side stories. However, my game crashes after the first prompt of the story. Can anyone tell me why? Any help is appreciated.

    Thanks

    Here is my code:
    Module Module1

    Sub Main()
    Dim name As String
    Dim answer1 As String
    Dim lifepoints As Integer

    lifepoints = 5

    'Introduction
    Console.BackgroundColor = ConsoleColor.Red
    Console.WriteLine("This game is rated 15+")
    Console.BackgroundColor = ConsoleColor.Black
    Console.ForegroundColor = ConsoleColor.Yellow
    Console.WriteLine("Developed by S47W4N")
    Console.ForegroundColor = ConsoleColor.Cyan
    Console.WriteLine("Twitter: @S47W4N <------ Follow that amazing guy")
    Console.WriteLine(" ")
    Console.WriteLine(" ")



    'Game Startup
    Console.WriteLine("Welcome to Adventure of a lifetime!") 'Game Talking
    Console.WriteLine("Please enter your name: ") 'Game Talking
    Console.ForegroundColor = ConsoleColor.DarkBlue 'User input colour
    name = Console.ReadLine()


    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.ForegroundColor = ConsoleColor.White
    Console.Write("In this game you have 5 Life Points - Lose them you get caught buy the infamous") 'Game Talking
    Console.ForegroundColor = ConsoleColor.Red
    Console.Read()
    Console.Write(" Mr Dudley")
    Console.Read()
    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.Read()
    Console.ForegroundColor = ConsoleColor.White
    Console.WriteLine("Lives: " & lifepoints)
    Console.WriteLine("You are a amatuer hacker who attends a boring school")
    Console.Read()
    Console.WriteLine("Your job is to bypass all of the school's security measures and to be the dominant hacker - Good Luck")
    Console.Read()
    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.BackgroundColor = ConsoleColor.Blue
    Console.WriteLine("Day 1")
    Console.BackgroundColor = ConsoleColor.Black
    Console.Read()
    Console.WriteLine("It is your first computing lesson with Mr Dudley, " & name & " be prepared for anything...")
    Console.Read()
    Console.WriteLine("Mr Dudley tells you to research about how a computer works. You already know how a computer works.")
    Console.WriteLine("Do you:
    A. Use this opportunity to evaluate the system and look for exploits
    B. Do as Mr Dudley says")
    answer1 = Console.Read()


    If answer1 = "A." Then
    Console.WriteLine("You find out that the servers have no antivirus software")
    Console.WriteLine("You run out of time to do anything else")
    Console.BackgroundColor = ConsoleColor.Blue
    Console.WriteLine(" ")
    Console.WriteLine(" ")
    Console.WriteLine("Day 2 - Two days later")
    Console.BackgroundColor = ConsoleColor.Black
    Console.Read()
    Console.WriteLine("Lives: " & lifepoints)
    Console.Read()
    End






    ElseIf answer1 = "B." Then
    Console.WriteLine("You run out of time to do anything else as Mr Dudley keeps giving you work")
    Console.WriteLine("-1 Life")
    Console.Read()
    lifepoints = lifepoints - 1
    Console.BackgroundColor = ConsoleColor.Blue

    Console.WriteLine("Day 2 - Two days later")
    Console.BackgroundColor = ConsoleColor.Black
    Console.Read()
    Console.WriteLine("Lives: " & lifepoints)
    Console.Read()
    Console.WriteLine("")
    End




    End If


    Console.Read()
    End Sub

    End Module
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Did TEF Bronze Award affect your UCAS choices?
    Useful resources

    Study tools

    Rosette

    Essay expert

    Learn to write like a pro with our ultimate essay guide.

    Thinking about uni already?

    Thinking about uni already?

    See where you can apply with our uni match tool

    Student chat

    Ask a question

    Chat to other GCSE students and get your study questions answered.

    Creating

    Make study resources

    Create all the resources you need to get the grades.

    Planner

    Create your own Study Plan

    Organise all your homework and exams so you never miss another deadline.

    Resources by subject

    From flashcards to mind maps; there's everything you need for all of your GCSE subjects.

    Papers

    Find past papers

    100s of GCSE past papers for all your subjects at your fingertips.

    Help out other students

    Can you help? Study help unanswered threads

    Groups associated with this forum:

    View associated groups
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.