diff --git "a/Gitoctopsoctops.py\357\200\242" "b/Gitoctopsoctops.py\357\200\242" new file mode 100644 index 0000000..901a11c --- /dev/null +++ "b/Gitoctopsoctops.py\357\200\242" @@ -0,0 +1,298 @@ + + SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS + + Commands marked with * may be preceded by a number, _N. + Notes in parentheses indicate the behavior if _N is given. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. + + h H Display this help. + q :q Q :Q ZZ Exit. + --------------------------------------------------------------------------- + + MMOOVVIINNGG + + e ^E j ^N CR * Forward one line (or _N lines). + y ^Y k ^K ^P * Backward one line (or _N lines). + f ^F ^V SPACE * Forward one window (or _N lines). + b ^B ESC-v * Backward one window (or _N lines). + z * Forward one window (and set window to _N). + w * Backward one window (and set window to _N). + ESC-SPACE * Forward one window, but don't stop at end-of-file. + d ^D * Forward one half-window (and set half-window to _N). + u ^U * Backward one half-window (and set half-window to _N). + ESC-) RightArrow * Right one half screen width (or _N positions). + ESC-( LeftArrow * Left one half screen width (or _N positions). + ESC-} ^RightArrow Right to last column displayed. + ESC-{ ^LeftArrow Left to first column. + F Forward forever; like "tail -f". + ESC-F Like F but stop when search pattern is found. + r ^R ^L Repaint screen. + R Repaint screen, discarding buffered input. + --------------------------------------------------- + Default "window" is the screen height. + Default "half-window" is half of the screen height. + --------------------------------------------------------------------------- + + SSEEAARRCCHHIINNGG + + /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. + ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. + n * Repeat previous search (for _N-th occurrence). + N * Repeat previous search in reverse direction. + ESC-n * Repeat previous search, spanning files. + ESC-N * Repeat previous search, reverse dir. & spanning files. + ESC-u Undo (toggle) search highlighting. + ESC-U Clear search highlighting. + &_p_a_t_t_e_r_n * Display only matching lines. + --------------------------------------------------- + A search pattern may begin with one or more of: + ^N or ! Search for NON-matching lines. + ^E or * Search multiple files (pass thru END OF FILE). + ^F or @ Start search at FIRST file (for /) or last file (for ?). + ^K Highlight matches, but don't move (KEEP position). + ^R Don't use REGULAR EXPRESSIONS. + ^S _n Search for match in _n-th parenthesized subpattern. + ^W WRAP search if no match found. + --------------------------------------------------------------------------- + + JJUUMMPPIINNGG + + g < ESC-< * Go to first line in file (or line _N). + G > ESC-> * Go to last line in file (or line _N). + p % * Go to beginning of file (or _N percent into file). + t * Go to the (_N-th) next tag. + T * Go to the (_N-th) previous tag. + { ( [ * Find close bracket } ) ]. + } ) ] * Find open bracket { ( [. + ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. + ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. + --------------------------------------------------- + Each "find close bracket" command goes forward to the close bracket + matching the (_N-th) open bracket in the top line. + Each "find open bracket" command goes backward to the open bracket + matching the (_N-th) close bracket in the bottom line. + + m_<_l_e_t_t_e_r_> Mark the current top line with . + M_<_l_e_t_t_e_r_> Mark the current bottom line with . + '_<_l_e_t_t_e_r_> Go to a previously marked position. + '' Go to the previous position. + ^X^X Same as '. + ESC-m_<_l_e_t_t_e_r_> Clear a mark. + --------------------------------------------------- + A mark is any upper-case or lower-case letter. + Certain marks are predefined: + ^ means beginning of the file + $ means end of the file + --------------------------------------------------------------------------- + + CCHHAANNGGIINNGG FFIILLEESS + + :e [_f_i_l_e] Examine a new file. + ^X^V Same as :e. + :n * Examine the (_N-th) next file from the command line. + :p * Examine the (_N-th) previous file from the command line. + :x * Examine the first (or _N-th) file from the command line. + :d Delete the current file from the command line list. + = ^G :f Print current file name. + --------------------------------------------------------------------------- + + MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS + + -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. + --_<_n_a_m_e_> Toggle a command line option, by name. + __<_f_l_a_g_> Display the setting of a command line option. + ___<_n_a_m_e_> Display the setting of an option, by name. + +_c_m_d Execute the less cmd each time a new file is examined. + + !_c_o_m_m_a_n_d Execute the shell command with $SHELL. + #_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt. + |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. + s _f_i_l_e Save input to a file. + v Edit the current file with $VISUAL or $EDITOR. + V Print version number of "less". + --------------------------------------------------------------------------- + + OOPPTTIIOONNSS + + Most options may be changed either on the command line, + or from within less by using the - or -- command. + Options may be given in one of two forms: either a single + character preceded by a -, or a name preceded by --. + + -? ........ --help + Display help (from command line). + -a ........ --search-skip-screen + Search skips current screen. + -A ........ --SEARCH-SKIP-SCREEN + Search starts just after target line. + -b [_N] .... --buffers=[_N] + Number of buffers. + -B ........ --auto-buffers + Don't automatically allocate buffers for pipes. + -c ........ --clear-screen + Repaint by clearing rather than scrolling. + -d ........ --dumb + Dumb terminal. + -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r + Set screen colors. + -e -E .... --quit-at-eof --QUIT-AT-EOF + Quit at end of file. + -f ........ --force + Force open non-regular files. + -F ........ --quit-if-one-screen + Quit if entire file fits on first screen. + -g ........ --hilite-search + Highlight only last match for searches. + -G ........ --HILITE-SEARCH + Don't highlight any matches for searches. + -h [_N] .... --max-back-scroll=[_N] + Backward scroll limit. + -i ........ --ignore-case + Ignore case in searches that do not contain uppercase. + -I ........ --IGNORE-CASE + Ignore case in all searches. + -j [_N] .... --jump-target=[_N] + Screen position of target lines. + -J ........ --status-column + Display a status column at left edge of screen. + -k [_f_i_l_e] . --lesskey-file=[_f_i_l_e] + Use a lesskey file. + -K ........ --quit-on-intr + Exit less in response to ctrl-C. + -L ........ --no-lessopen + Ignore the LESSOPEN environment variable. + -m -M .... --long-prompt --LONG-PROMPT + Set prompt style. + -n ......... --line-numbers + Suppress line numbers in prompts and messages. + -N ......... --LINE-NUMBERS + Display line number at start of each line. + -o [_f_i_l_e] . --log-file=[_f_i_l_e] + Copy to log file (standard input only). + -O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e] + Copy to log file (unconditionally overwrite). + -p [_p_a_t_t_e_r_n] --pattern=[_p_a_t_t_e_r_n] + Start at pattern (from command line). + -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] + Define new prompt. + -q -Q .... --quiet --QUIET --silent --SILENT + Quiet the terminal bell. + -r -R .... --raw-control-chars --RAW-CONTROL-CHARS + Output "raw" control characters. + -s ........ --squeeze-blank-lines + Squeeze multiple blank lines. + -S ........ --chop-long-lines + Chop (truncate) long lines rather than wrapping. + -t [_t_a_g] .. --tag=[_t_a_g] + Find a tag. + -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] + Use an alternate tags file. + -u -U .... --underline-special --UNDERLINE-SPECIAL + Change handling of backspaces, tabs and carriage returns. + -V ........ --version + Display the version number of "less". + -w ........ --hilite-unread + Highlight first new line after forward-screen. + -W ........ --HILITE-UNREAD + Highlight first new line after any forward movement. + -x [_N[,...]] --tabs=[_N[,...]] + Set tab stops. + -X ........ --no-init + Don't use termcap init/deinit strings. + -y [_N] .... --max-forw-scroll=[_N] + Forward scroll limit. + -z [_N] .... --window=[_N] + Set size of window. + -" [_c[_c]] . --quotes=[_c[_c]] + Set shell quote characters. + -~ ........ --tilde + Don't display tildes after end of file. + -# [_N] .... --shift=[_N] + Set horizontal scroll amount (0 = one half screen width). + --exit-follow-on-close + Exit F command on a pipe when writer closes pipe. + --file-size + Automatically determine the size of the input file. + --follow-name + The F command changes files if the input file is renamed. + --header=[_N[,_M]] + Use N lines and M columns to display file headers. + --incsearch + Search file as each pattern character is typed in. + --intr=_C + Use _C instead of ^X to interrupt a read. + --line-num-width=_N + Set the width of the -N line number field to _N characters. + --modelines=_N + Read _N lines from the input file and look for vim modelines. + --mouse + Enable mouse input. + --no-keypad + Don't send termcap keypad init/deinit strings. + --no-histdups + Remove duplicates from command history. + --no-number-headers + Don't give line numbers to header lines. + --no-search-headers + Don't search in header lines or columns. + --no-vbell + Disable the terminal's visual bell. + --redraw-on-quit + Redraw final screen when quitting. + --rscroll=_C + Set the character used to mark truncated lines. + --save-marks + Retain marks across invocations of less. + --search-options=[EFKNRW-] + Set default options for every search. + --show-preproc-errors + Display a message if preprocessor exits with an error status. + --proc-backspace + Process backspaces for bold/underline. + --SPECIAL-BACKSPACE + Treat backspaces as control characters. + --proc-return + Delete carriage returns before newline. + --SPECIAL-RETURN + Treat carriage returns as control characters. + --proc-tab + Expand tabs to spaces. + --SPECIAL-TAB + Treat tabs as control characters. + --status-col-width=_N + Set the width of the -J status column to _N characters. + --status-line + Highlight or color the entire line containing a mark. + --use-backslash + Subsequent options use backslash as escape char. + --use-color + Enables colored text. + --wheel-lines=_N + Each click of the mouse wheel moves _N lines. + --wordwrap + Wrap lines at spaces. + + + --------------------------------------------------------------------------- + + LLIINNEE EEDDIITTIINNGG + + These keys can be used to edit text being entered + on the "command line" at the bottom of the screen. + + RightArrow ..................... ESC-l ... Move cursor right one character. + LeftArrow ...................... ESC-h ... Move cursor left one character. + ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. + ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. + HOME ........................... ESC-0 ... Move cursor to start of line. + END ............................ ESC-$ ... Move cursor to end of line. + BACKSPACE ................................ Delete char to left of cursor. + DELETE ......................... ESC-x ... Delete char under cursor. + ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. + ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. + ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. + UpArrow ........................ ESC-k ... Retrieve previous command line. + DownArrow ...................... ESC-j ... Retrieve next command line. + TAB ...................................... Complete filename & cycle. + SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. + ctrl-L ................................... Complete filename, list all. diff --git a/assets/img/Empty.png b/assets/img/Empty.png new file mode 100644 index 0000000..0cb6d41 Binary files /dev/null and b/assets/img/Empty.png differ diff --git a/assets/img/along.png b/assets/img/along.png new file mode 100644 index 0000000..5e6ce3f Binary files /dev/null and b/assets/img/along.png differ diff --git a/assets/img/alongcomplete.png b/assets/img/alongcomplete.png new file mode 100644 index 0000000..82f2516 Binary files /dev/null and b/assets/img/alongcomplete.png differ diff --git a/assets/img/alongicon.png b/assets/img/alongicon.png new file mode 100644 index 0000000..0674c49 Binary files /dev/null and b/assets/img/alongicon.png differ diff --git a/assets/img/counter_terrorist.png b/assets/img/counter_terrorist.png new file mode 100644 index 0000000..d53efaf Binary files /dev/null and b/assets/img/counter_terrorist.png differ diff --git a/assets/img/cross.png b/assets/img/cross.png new file mode 100644 index 0000000..650fea1 Binary files /dev/null and b/assets/img/cross.png differ diff --git a/assets/img/terrorist.png b/assets/img/terrorist.png new file mode 100644 index 0000000..6701a27 Binary files /dev/null and b/assets/img/terrorist.png differ diff --git a/octops.py b/octops.py index 16dd0f6..7177128 100644 --- a/octops.py +++ b/octops.py @@ -7,6 +7,7 @@ #------------------------Imports-------------------------# +#main file from kivy.config import Config Config.set('kivy','window_icon','assets/img/main_mascot.png') @@ -28,6 +29,7 @@ from screens.doors import DoorsScreen from screens.spawn import SpawnScreen from screens.map import MapScreen +from screens.long import LongScreen #--------------------------App--------------------------# @@ -46,6 +48,8 @@ def build(self): sm.add_widget(DoorsScreen(name='doors')) sm.add_widget(SpawnScreen(name='spawn')) + sm.add_widget(LongScreen(name='long')) + return sm def open_settings(self, *largs): diff --git a/screenLayout/long.kv b/screenLayout/long.kv new file mode 100644 index 0000000..206a9cc --- /dev/null +++ b/screenLayout/long.kv @@ -0,0 +1,297 @@ +: + FloatLayout: + # Initialize background splash image + BoxLayout: + id: splash_bg + opacity: 1 + AsyncImage: + source: 'assets/img/along.png' + allow_stretch: True + keep_ratio: False + size_hint: 1, 1 + + # Initialize a matrix of 3x3 buttons each with unique id, text and position + Button: + id: 1 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(100), dp(100) + pos: dp(450), dp(430) + disabled: True if splash_bg_after.opacity == 1 else False # Ensure buttons stay enabled until puzzle is solved + on_press: + root.change_img(self, 1) # Call function to toggle button image from grey to green upon press + root.check_product(self, 1) # Call function to check whether correct combination entered or not + Image: + source: 'assets/img/terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 1 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + 30 + center_y: self.parent.top - 60 + + Button: + id: 2 + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(100), dp(100) + pos: dp(250), dp(300) + disabled: True if splash_bg_after.opacity == 1 else False # Ensure buttons stay enabled until puzzle is solved + on_press: + root.change_img(self, 2) # Call function to toggle button image from grey to green upon press + root.check_product(self, 2) # Call function to check whether correct combination entered or not + + Image: + source: 'assets/img/terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 2 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + 30 + center_y: self.parent.top - 60 + + Button: + id: 3 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(250), dp(40) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 3) + root.check_product(self, 3) + + Image: + source: 'assets/img/counter_terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 3 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Button: + id: 4 + #text: "Ѧ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(425), dp(350) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 4) + root.check_product(self, 4) + + Image: + source: 'assets/img/counter_terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 4 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Button: + id: 5 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(430), dp(50) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self,5) # Use the correct button ID (5) + root.check_product(self,5) # Use the correct button ID (5) + + Image: + source: 'assets/img/terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 5 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Button: + id: 6 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(50), dp(75) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 6) + root.check_product(self, 6) + + Image: + source: 'assets/img/counter_terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 6 + source: 'assets/img/symbols/off.png' + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + 30 + center_y: self.parent.top - 60 + + Button: + id: 7 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(475), dp(200) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 7) + root.check_product(self, 7) + + Image: + source: 'assets/img/terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 7 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + 30 + center_y: self.parent.top - 60 + + Button: + id: 8 + # text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(150), dp(350) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 8) + root.check_product(self, 8) + + Image: + source: 'assets/img/counter_terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + + Image: + id: 8 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Button: + id: 9 + #text: "Φ" + font_size: "65sp" + color: 255,255,255 + halign: 'center' + valign: 'bottom' + background_color: 0,0,0,0 + size_hint: None,None + size: dp(80), dp(80) + pos: dp(340), dp(175) + disabled: True if splash_bg_after.opacity == 1 else False + on_press: + root.change_img(self, 9) + root.check_product(self, 9) + + Image: + source: 'assets/img/counter_terrorist.png' + size: dp(130), dp(130) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + Image: + id: 9 + source: 'assets/img/Empty.png' # Initialize each button with a grey (off) image + size: dp(100), dp(100) + center_x: self.parent.center_x + center_y: self.parent.top - 60 + + # Initialize background image to be switched to on correct combination + BoxLayout: + id: splash_bg_after + orientation: 'vertical' + opacity: 0 + AsyncImage: + source: 'assets/img/alongcomplete.png' + allow_stretch: True + keep_ratio: False + size_hint: 1, 1 + + # Initialize return button to map window + Button: + size_hint: None,None + size: dp(60), dp(60) + pos: dp(12), dp(523) + background_color: 0,0,0,0 + on_press: root.manager.current = 'map' + + Image: + source: 'assets/img/button_return.png' + center_x: self.parent.center_x + center_y: self.parent.center_y diff --git a/screenLayout/map_screen.kv b/screenLayout/map_screen.kv index 0f78f08..115bac1 100644 --- a/screenLayout/map_screen.kv +++ b/screenLayout/map_screen.kv @@ -52,7 +52,7 @@ Button: size_hint: None,None size: dp(135), dp(135) - pos: dp(297), dp(147) + pos: dp(247), dp(147) background_color: 0,0,0,0 on_press: root.manager.current = 'doors' @@ -77,3 +77,18 @@ size: dp(135), dp(135) center_x: self.parent.center_x center_y: self.parent.center_y + + #long + Button: + size_hint: None,None + size: dp(135), dp(135) + pos: dp(450), dp(200) + background_color: 0,0,0,0 + on_press: root.manager.current = 'long' + + Image: + source: 'assets/img/alongicon.png' + size_hint: (1, 1) + size: dp(300), dp(140) + center_x: self.parent.center_x + center_y: self.parent.center_y \ No newline at end of file diff --git a/screenLayout/sitea_screen.kv b/screenLayout/sitea_screen.kv index 188812c..1c0b53e 100644 --- a/screenLayout/sitea_screen.kv +++ b/screenLayout/sitea_screen.kv @@ -44,7 +44,16 @@ size_hint: None,None size: dp(80), dp(80) pos: dp(261), dp(347) - disabled: True + disabled: True if splash_bg_after.opacity == 1 else False # Ensure buttons stay enabled until puzzle is solved + on_press: + root.change_img(self, 2) # Call function to toggle button image from grey to green upon press + root.check_product(self, 2) # Call function to check whether correct combination entered or not + + Image: + id: 2 + source: 'assets/img/symbols/off.png' # Initialize each button with a grey (off) image + center_x: self.parent.center_x + center_y: self.parent.top - 10 @@ -112,8 +121,8 @@ pos: dp(261), dp(242) disabled: True if splash_bg_after.opacity == 1 else False on_press: - root.change_img(self, 4) - root.check_product(self, 4) + root.change_img(self,5) # Use the correct button ID (5) + root.check_product(self,5) # Use the correct button ID (5) Image: id: 5 diff --git a/screens/doors.py b/screens/doors.py index f75985c..5936f00 100644 --- a/screens/doors.py +++ b/screens/doors.py @@ -6,23 +6,30 @@ Builder.load_file('screenLayout/doors_screen.kv') sound = SoundLoader.load('assets/audio/doors_roger.wav') +#defining a class for doorscreen class DoorsScreen(Screen): - verified = False - + verified = False#initially setting it to false to later check if it turns true or not + + #increasing the value of the label counter in the game as needed. adding 1 at a time + #resetting it to 0 once it reaches 9 def increment_value(self, label_index): - if(int(label_index.text) == 5): + if(int(label_index.text) == 9): label_index.text = "0" else: label_index.text = f"{int(label_index.text) + 1}" DoorsScreen.verify(self) + #decreasing the value of the label counter in the game as needed. decreasing 1 at a time + #resetting it to 9 once it reaches 0 def decrement_value(self, label_index): if(int(label_index.text) == 0): - label_index.text = "5" + label_index.text = "9" else: label_index.text = f"{int(label_index.text) - 1}" DoorsScreen.verify(self) + #checking if the entered label is equal to the passcode saved in screen_check.py is same or not + #if same, then changing bool verified to true, and playinf the exit sounds and making the background screen opaque def verify(self): code = passcode == int(self.ids.label_1.text + self.ids.label_2.text + self.ids.label_3.text + self.ids.label_4.text) if not DoorsScreen.verified and code: diff --git a/screens/long.py b/screens/long.py new file mode 100644 index 0000000..9ca2543 --- /dev/null +++ b/screens/long.py @@ -0,0 +1,46 @@ +from kivy.lang import Builder +from kivy.uix.screenmanager import Screen +from kivy.core.audio import SoundLoader +from kivy.uix.image import Image + + +from .screen_check import set_long + +# Import and load .kv file containing widget and layout info along with audio files to be played in the window +Builder.load_file('screenLayout/long.kv') +sound = SoundLoader.load('assets/audio/spawn_sticktog.wav') +class LongScreen(Screen): + pressed_buttons = [] + + def show_overlay(self): # Updating the window state after correct combination + self.ids.splash_bg.opacity = 0 + self.ids.splash_bg_after.opacity = 1 + self.pressed_buttons = [] + + def change_img(self, button, idOG): # Toggle the button states to on(green)/off(grey) on press + idOG_dynamic = f"{idOG}" + widget = getattr(self.ids, idOG_dynamic, None) + widget.source = "assets/img/cross.png" if widget.source == "assets/img/Empty.png" else "assets/img/Empty.png" + + def check_product(self, instance, id): # Check for correct code combination + button_id = id + self.pressed_buttons.append(id) + x = "" + if len(self.pressed_buttons) == 4: # Check every 4 button press + product = 1 + for button_id in self.pressed_buttons: + product *= button_id + + if product == 70: # Check whether correct combination is entered + x = "Valid" + sound.play() + self.show_overlay() + set_long() # Update global sitea flag variable + else: + x = "Invalid" + + if x == "Invalid": # Toggle all on(green) button states to off(grey) and clear all previous entries + for button in self.pressed_buttons: + widget = getattr(self.ids, f"{button}", None) + widget.source = "assets/img/Empty.png" + self.pressed_buttons = [] diff --git a/screens/screen_check.py b/screens/screen_check.py index a449f24..a3f4219 100644 --- a/screens/screen_check.py +++ b/screens/screen_check.py @@ -3,6 +3,7 @@ sitea = devMode doors = devMode spawn = devMode +long = devMode passcode = 1275 #linked to bomb hints png slider = [25, 55, 100] #linked to the marks on tracks time = 0 @@ -33,4 +34,11 @@ def set_time(val): time = val def get_time(): - return time \ No newline at end of file + return time + +def set_long(): + global long + long = not long + +def get_long(): + return long \ No newline at end of file diff --git a/screens/siteA.py b/screens/siteA.py index b310bca..72383dd 100644 --- a/screens/siteA.py +++ b/screens/siteA.py @@ -18,7 +18,7 @@ def show_overlay(self): # Updating the window state after correct combination def change_img(self, button, idOG): # Toggle the button states to on(green)/off(grey) on press idOG_dynamic = f"{idOG}" widget = getattr(self.ids, idOG_dynamic, None) - widget.source = "assets/img/symbols/off.png" if widget.source == "assets/img/symbols/off.png" else "assets/img/symbols/off.png" + widget.source = "assets/img/symbols/on.png" if widget.source == "assets/img/symbols/off.png" else "assets/img/symbols/off.png" def check_product(self, instance, id): # Check for correct code combination button_id = id diff --git a/screens/siteB.py b/screens/siteB.py index 3704ba4..379e81f 100644 --- a/screens/siteB.py +++ b/screens/siteB.py @@ -5,7 +5,7 @@ from kivy.uix.screenmanager import Screen from kivy.core.audio import SoundLoader -from .screen_check import passcode, get_spawn, get_doors, get_sitea, get_time +from .screen_check import passcode, get_spawn, get_doors, get_sitea, get_time, get_long from .map import MapScreen Builder.load_file('screenLayout/siteb_screen.kv') @@ -20,18 +20,18 @@ def Delay(delay): return Animation(duration=delay) def on_enter(self): - if not SiteBScreen.visited and not (get_spawn() and get_sitea() and get_doors()): + if not SiteBScreen.visited and not (get_spawn() and get_sitea() and get_doors() and get_long()): SiteBScreen.visited = True octocat_icon = self.Delay(0.5) + Animation(color=(1,1,1,1), pos= (dp(0), dp(0)), duration=0.2, t='out_quad') + self.Delay(3.5) + Animation(color=(1,1,1,0), duration=0.2, t='out_quad') octocat_icon.start(self.ids.octocat_icon) text_bubble = self.Delay(1) + Animation(color=(1,1,1,1), pos = (dp(233), dp(155)), duration=0.2, t='out_quad') + self.Delay(3.5) + Animation(color=(1,1,1,0), pos = (dp(233), dp(155)), duration=0.2, t='out_quad') text_bubble.start(self.ids.octocat_hint) - if get_spawn() and get_sitea() and get_doors() and not SiteBScreen.defused: + if get_spawn() and get_sitea() and get_doors() and get_long() and not SiteBScreen.defused: self.ids.defuse_img.color = (1,1,1,1) def defuse_btn_press(self): - if get_sitea() and get_doors() and get_spawn() and not SiteBScreen.defused: + if get_sitea() and get_doors() and get_spawn() and get_long() and not SiteBScreen.defused: SiteBScreen.defused = True MapScreen.stop_timer(self) Animation(color= (1,1,1,0.5), duration=0.5).start(self.ids.defuse_img) diff --git a/screens/spawn.py b/screens/spawn.py index f770ff0..5762717 100644 --- a/screens/spawn.py +++ b/screens/spawn.py @@ -10,7 +10,7 @@ class SpawnScreen(Screen): verified = False def slider_val_change(self): - if not SpawnScreen.verified and ((self.ids.slide1.value < slider[0]+5) and (self.ids.slide1.value > slider[0]-5 )) and ((self.ids.slide2.value < slider[2]+5)and ( self.ids.slide2.value > slider[2]-5 )) and ((self.ids.slide3.value < slider[2]+5) and (self.ids.slide3.value > slider[2]-5 )): + if not SpawnScreen.verified and ((self.ids.slide1.value < slider[0]+5) and (self.ids.slide1.value > slider[0]-5 )) and ((self.ids.slide2.value < slider[1]+5)and ( self.ids.slide2.value > slider[1]-5 )) and ((self.ids.slide3.value < slider[2]+5) and (self.ids.slide3.value > slider[2]-5 )): SpawnScreen.verified = True self.ids.splash_bg.opacity = 0 self.ids.splash_bg_after.opacity = 1