Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/octops.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added assets/img/a-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/alongcomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/alongicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/symbols/hidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/symbols/long_bomb_tile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/symbols/reveal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions octops.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from screens.doors import DoorsScreen
from screens.spawn import SpawnScreen
from screens.map import MapScreen
from screens.long import LongScreen

#--------------------------App--------------------------#

Expand All @@ -46,6 +47,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):
Expand Down
190 changes: 190 additions & 0 deletions screenLayout/long.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<LongScreen>:
FloatLayout:
# Initialize background splash image
BoxLayout:
id: splash_bg
opacity: 1
AsyncImage:
source: 'assets/img/a-long.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
size_hint: None,None
size: dp(80), dp(80)
pos: dp(148), dp(347)
color: 157,128,99
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 reveal button if bomb or not
root.check_product(self, 1) #call function to check if the cklicked button has bomb or not

Image:
id: 1
source: 'assets/img/symbols/hidden.png' # Initialize each button with a grey (hidden) image
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 2
size_hint: None,None
size: dp(80), dp(80)
pos: dp(261), dp(347)
color: 157,128,99
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)
root.check_product(self, 2)

Image:
id: 2
source: 'assets/img/symbols/hidden.png' # Initialize each button with a grey (off) image
center_x: self.parent.center_x
center_y: self.parent.center_y


Button:
id: 3
size_hint: None,None
size: dp(80), dp(80)
pos: dp(375), dp(347)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 3)
root.check_product(self, 3)

Image:
id: 3
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 4
size_hint: None,None
size: dp(80), dp(80)
pos: dp(148), dp(242)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 4)
root.check_product(self, 4)

Image:
id: 4
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 5
size_hint: None,None
size: dp(80), dp(80)
pos: dp(261), dp(242)
color: 157,128,99
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:
id: 5
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 6
size_hint: None,None
size: dp(80), dp(80)
pos: dp(375), dp(242)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 6)
root.check_product(self, 6)

Image:
id: 6
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 7
size_hint: None,None
size: dp(80), dp(80)
pos: dp(148), dp(137)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 7)
root.check_product(self, 7)

Image:
id: 7
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 8
size_hint: None,None
size: dp(80), dp(80)
pos: dp(261), dp(137)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 8)
root.check_product(self, 8)

Image:
id: 8
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

Button:
id: 9
size_hint: None,None
size: dp(80), dp(80)
pos: dp(375), dp(137)
color: 157,128,99
disabled: True if splash_bg_after.opacity == 1 else False
on_press:
root.change_img(self, 9)
root.check_product(self, 9)

Image:
id: 9
source: 'assets/img/symbols/hidden.png'
center_x: self.parent.center_x
center_y: self.parent.center_y

# 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' #add a file named "a_long_splash" that will be the ending screen
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
17 changes: 16 additions & 1 deletion screenLayout/map_screen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
9 changes: 6 additions & 3 deletions screenLayout/sitea_screen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
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
on_press:
root.change_img(self, 2)
root.check_product(self, 2)



Expand Down Expand Up @@ -112,8 +115,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)
root.check_product(self, 5)

Image:
id: 5
Expand Down
15 changes: 11 additions & 4 deletions screens/doors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading