Section 2: Termnial Hacker

Date of Work: 17/08/2019.

The Codes I chose for the game:

Easy - Coffee Shop:
water, beans, teas, cake, cocoa.
Medium - Library:
books, shelves, computers, renew, author.
Hard - Space/NASA:
astronaut, satellite, telescope, shuttle, voyager, hubble, rovers.
------------------------------------------------------------------------------------

Getting everything imported and ready!

Got the Terminal.Line(“Hello World”); Working!

Laying out the home menu:
Doesn’t look too bad need to fix that formating at the top though!

Cleaned it up and added some polish to the end help section:

------------------------------------------------------------------------------------------------------------------------------------------

I successfully "refactored the ShowMainMenu function!

------------------------------------------------------------------------------------------------------------------------------------------

Adding in my first Variable! :blush: They code up so fast :sob:


I fixed the rogue captilisation!
------------------------------------------------------------------------------------------------------------------------------------------
I got through the Functions with Varible Parameters, but I struggled a bit to correctly place it however I got it in the end.


------------------------------------------------------------------------------------------------------------------------------------------
I added the Special Functions and I manged to get it printing to the console and the terminal.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
v009a
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
v009c
------------------------------------------------------------------------------------------------------------------------------------------

I kind of got the true/false state to work in my owwn way I used a If state ment saying

if (input == “1”)
{
print(“true”);
}

which kind of worked but it isn’t actually checking the players input to be true or false. So I watch the video and followed along with Ben’s example.

v010

I’ll finish for today and carry on tomorrow with the IF statement section! T.T.F.N! :smile:
------------------------------------------------------------------------------------------------------------------------------------------
Date of Work - 18/07/2019:
Today I’m going to continue with the IF statement section. I went ahead by myself and created this in the OnUserInput() section.
v011


However there’s an error with else statement but I might have made too many else if statements so maybe that’ll fix it, I’ll also add a message for the help menu too? I’ll try that then and see what happens if it doesn’t work follow the tutorial.

I got the script to kind of work however it’s showing the not valid selection for all choices.
I fixed it buy adding else infront of the other if statements

v011d

I followed the challenge and added the main menu, level selections and added some secret messages for my family to have a look at!

After watching more of the lecture I found out I almost had the menu selection correct. I forgot to add a message to the message area which caused errors but now it’s fixed and working as intended!


since I added the “Welcome Player!” I’ll change the next message down so I don’t repeat the Welcome twice.
------------------------------------------------------------------------------------------------------------------------------------------

Following along with the member variables ection and I got the level selection working. I’m now going to use this for all the of levels, fix the spacing and try get the game back to the main menu too.




I got the menu return working too by assigning level = 0; to the main menu function.

v016
------------------------------------------------------------------------------------------------------------------------------------------


Using the enum state I followed Ben’s example and then I followed how he setup the currentScreens for the main menu and the levels however I think I’ve done it incorrectly because I put it in the start game Function. It might need to be in each level because each level requires a different password.

v018

It still works in naming the start game function as the password level but might cause trouble in the future, I’ll see what Ben does.

Oh guess it was the right place after all
------------------------------------------------------------------------------------------------------------------------------------------
I started refactoring my code and I followed Bens example and extracted the levels but I left the easter eggs and help in the main OnUserInput which caused it to not work correctly so I shifted it all into the RunMainMenu.

------------------------------------------------------------------------------------------------------------------------------------------
first solo, I did okay I just need to remember to add parameter variables to functions. I tried an array haha. and then thought no it must be easier than this and I started faffing with creating new current states etc. I couldn’t get my head around it and watched Ben go through the code and I was so close I had the right idea I just wasn’t connecting them properly with the game states. here’s my final code for this section!


------------------------------------------------------------------------------------------------------------------------------------------
Implemented the arrays which went really well! can’t wait to add the randomiser.

v021

Oh I’m excited! I have a much better understanding of this coding course now!
------------------------------------------------------------------------------------------------------------------------------------------
If vs Switch statements. I like if statements because I’m more comfortable with it however I like how compact switch statements are.

v022
v022b

------------------------------------------------------------------------------------------------------------------------------------------
random generator.

I started the random generator section and managed to get it working too! I forgot to put index in the array selection [ AREA ] but no problem typed in index and got it working. I ran into the Int index issue however I made it a game state and that seemed to work however I’ll switch it over to the way Ben has it for the sake of continuity.

v023b

Kinda looks like a mess but I’m sure the way I had it would cause arguements later in development plus I’ll refactor it if needed.
here’s the final peice and the way I had it couldv’e cause crashes or conflicts in the code itself (Guessing that second part)

v024

Updated Sun Aug 18 2019 23:43<- hey that’s neat! :astonished: :astonished:
------------------------------------------------------------------------------------------------------------------------------------------
Date of Work - 19/07/2019

I’ve added win screens each of the levels, I just googled Ascii art themed on the topic, I.E. Cafe, Library, NASA.

Here are the final screens, I might move the nasa one ab around for better clarity.



Updated Mon Aug 19 2019 13:19
------------------------------------------------------------------------------------------------------------------------------------------
Added the anagram mixer to the game and the Menu option to all the necessary pages!


Updated Mon Aug 19 2019 14:26
------------------------------------------------------------------------------------------------------------------------------------------
last section was just cleaning up the code making sure everything works alright etc etc.
I couldn’t get the ShareMyGame to work but no worries. I got my family to play it!

Updated Mon Aug 19 2019 15:06
------------------------------------------------------------------------------------------------------------------------------------------****------------------------------------------------------------------------------------------------------------------------------------------

2 Likes

Privacy & Terms