-
-
Notifications
You must be signed in to change notification settings - Fork 73
Litigious Liberators #3
Changes from all commits
7582e79
868bcae
aa5557b
f1d3ba6
b4e8c4e
03dac2b
576adfc
68a526f
daf2a31
20c8ef3
8d47d7d
7b4e938
69638da
abec9d1
d7a049f
8356351
fb0447e
40678d3
415c6d6
adb7399
9f2b4d3
e4ab4c3
4686cc4
be599cf
a23087a
f3004b0
cc9dae5
aacca77
5cadccf
cb73b46
eda650f
20971be
1cf65c9
ed6779d
b518ed0
5dc68ac
83896fa
f036731
01ff673
49d5040
2ae10b9
cebc36f
afdeb53
00a7a1b
5e8e372
b0e8b4e
da0c48f
6138f28
7b7f4dc
a8b7052
55d14c4
a27aac3
95034fd
c674d29
80f9ae9
47afee3
4d8f04a
1c82fee
a4dbb38
fa51178
5b37ece
efb6ddf
f84203e
699425b
042a867
a469e5b
22b5a40
153570a
b6b84a2
77ffea4
1ededd6
452ed68
309eba9
d297458
baddd06
38f0431
28c9f15
4d7a57a
6a30b61
e93b840
721d030
4dd6204
ca509c1
82447a8
0218b35
864cd94
b8f3cd6
b07f5b6
9c8707c
806ffb0
3ce424b
d7896aa
5c55e27
556e705
e269010
6cdfe62
6016c48
6a36526
4577930
b5abde7
1ca7129
bc3071d
162c221
2bad91b
1e1fc4a
24b3d3e
4a7d7da
a03725e
1911428
f36c126
78a344a
c9e72c8
0d70c4d
6759b45
f903a7a
e4b7bde
466971f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.2.3 | ||
hooks: | ||
- id: flake8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,56 @@ | ||
# Litigious Liberators | ||
# Resurgence | ||
### by Litigious Liberators | ||
|
||
Please use this README to document your team's project. Make sure to include a general description, information on how to set-up and run your project, and anything else you think may be interesting for a README. The README is usually the first document people read when they visit a project on GitHub, so it's a good idea to make it appealing. | ||
|
||
## Contents | ||
|
||
- [Setting up your repo](#setting-up-your-repo) | ||
- [Running the App](#running-the-app) | ||
- [Using the App](#using-the-app) | ||
- [Useful links](#useful-links) | ||
- [License](#license) | ||
|
||
|
||
### Setting up your repo | ||
|
||
Clone this repo: | ||
|
||
```bash | ||
$ git clone [email protected]:duarteocarmo/code-jam-6.git | ||
``` | ||
|
||
Create a virtualenv: | ||
|
||
```bash | ||
$ python -m venv <name_of_virtualenv> | ||
``` | ||
|
||
Activate it: | ||
|
||
```bash | ||
$ . <name_of_virtualenv>/env/activate | ||
``` | ||
|
||
Install dependencies | ||
|
||
```bash | ||
(env) $ cd litigious-liberators # navigate to our folder | ||
(env) $ pip install -r requirements.txt # install normal requirements | ||
(env) $ pip install -r requirements-dev.txt # install dev as well | ||
``` | ||
## Running the App: | ||
```bash | ||
python main.py | ||
``` | ||
## Using the App | ||
* Once you open the app and __single-click__ on the screen, the game's backstory will be presented. You can __double-click__ to skip the entire story. | ||
* After that, you need to create your profile. Enter your name and answer few simple questions to determine your initial stats to move on to the next screen. | ||
* Here you will be playing the actual game. You will be presented a scenario/individual where you have to press __right/left (keyboard)__ based on the choices displayed on the screen. To know more about the card, you can __click on the picture__. | ||
* Your goal is to maximise all the three stats without any of them going empty. These stats might increase or decrease based on your choices | ||
|
||
## Useful links | ||
|
||
|
||
- **Code Jam Rules:** [https://pythondiscord.com/pages/code-jams/code-jam-6/rules/](https://pythondiscord.com/pages/code-jams/code-jam-6/rules/) | ||
|
||
- **General Code Jam info:** [https://pythondiscord.com/pages/code-jams/code-jam-6/](https://pythondiscord.com/pages/code-jams/code-jam-6/) | ||
|
@@ -13,3 +60,6 @@ Please use this README to document your team's project. Make sure to include a g | |
## License | ||
|
||
All projects will merged into our Code Jam repository, which uses the [MIT license](../LICENSE). Please make sure that if you add assets, the licenses of those assets are compatible with the MIT license. | ||
|
||
|
||
There we go :) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
Copyright (c) 2011 by Sorkin Type Co (www.sorkintype.com), | ||
with Reserved Font Name "Oldenburg". | ||
|
||
This Font Software is licensed under the SIL Open Font License, Version 1.1. | ||
This license is copied below, and is also available with a FAQ at: | ||
http://scripts.sil.org/OFL | ||
|
||
|
||
----------------------------------------------------------- | ||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 | ||
----------------------------------------------------------- | ||
|
||
PREAMBLE | ||
The goals of the Open Font License (OFL) are to stimulate worldwide | ||
development of collaborative font projects, to support the font creation | ||
efforts of academic and linguistic communities, and to provide a free and | ||
open framework in which fonts may be shared and improved in partnership | ||
with others. | ||
|
||
The OFL allows the licensed fonts to be used, studied, modified and | ||
redistributed freely as long as they are not sold by themselves. The | ||
fonts, including any derivative works, can be bundled, embedded, | ||
redistributed and/or sold with any software provided that any reserved | ||
names are not used by derivative works. The fonts and derivatives, | ||
however, cannot be released under any other type of license. The | ||
requirement for fonts to remain under this license does not apply | ||
to any document created using the fonts or their derivatives. | ||
|
||
DEFINITIONS | ||
"Font Software" refers to the set of files released by the Copyright | ||
Holder(s) under this license and clearly marked as such. This may | ||
include source files, build scripts and documentation. | ||
|
||
"Reserved Font Name" refers to any names specified as such after the | ||
copyright statement(s). | ||
|
||
"Original Version" refers to the collection of Font Software components as | ||
distributed by the Copyright Holder(s). | ||
|
||
"Modified Version" refers to any derivative made by adding to, deleting, | ||
or substituting -- in part or in whole -- any of the components of the | ||
Original Version, by changing formats or by porting the Font Software to a | ||
new environment. | ||
|
||
"Author" refers to any designer, engineer, programmer, technical | ||
writer or other person who contributed to the Font Software. | ||
|
||
PERMISSION & CONDITIONS | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of the Font Software, to use, study, copy, merge, embed, modify, | ||
redistribute, and sell modified and unmodified copies of the Font | ||
Software, subject to the following conditions: | ||
|
||
1) Neither the Font Software nor any of its individual components, | ||
in Original or Modified Versions, may be sold by itself. | ||
|
||
2) Original or Modified Versions of the Font Software may be bundled, | ||
redistributed and/or sold with any software, provided that each copy | ||
contains the above copyright notice and this license. These can be | ||
included either as stand-alone text files, human-readable headers or | ||
in the appropriate machine-readable metadata fields within text or | ||
binary files as long as those fields can be easily viewed by the user. | ||
|
||
3) No Modified Version of the Font Software may use the Reserved Font | ||
Name(s) unless explicit written permission is granted by the corresponding | ||
Copyright Holder. This restriction only applies to the primary font name as | ||
presented to the users. | ||
|
||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font | ||
Software shall not be used to promote, endorse or advertise any | ||
Modified Version, except to acknowledge the contribution(s) of the | ||
Copyright Holder(s) and the Author(s) or with their explicit written | ||
permission. | ||
|
||
5) The Font Software, modified or unmodified, in part or in whole, | ||
must be distributed entirely under this license, and must not be | ||
distributed under any other license. The requirement for fonts to | ||
remain under this license does not apply to any document created | ||
using the Font Software. | ||
|
||
TERMINATION | ||
This license becomes null and void if any of the above conditions are | ||
not met. | ||
|
||
DISCLAIMER | ||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | ||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE | ||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | ||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | ||
OTHER DEALINGS IN THE FONT SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from kivy.app import App | ||
from kivy.uix.screenmanager import ScreenManager | ||
from onboarding.onboarding import OnboardingScreen | ||
from profile_cards.profile_cards import SelectionScreen, WinScreen, LossScreen | ||
from profile_creation.createprofile import CreateProfile | ||
from kivy.lang import Builder | ||
|
||
|
||
class ResurgenceApp(App): | ||
def build(self): | ||
Builder.load_file("onboarding/onboarding.kv") | ||
Builder.load_file("profile_creation/createprofile.kv") | ||
Builder.load_file("profile_cards/profiles.kv") | ||
sm = ScreenManager() | ||
sm.add_widget(OnboardingScreen(name="onboarding")) | ||
sm.add_widget(CreateProfile(name="create_profile")) | ||
sm.add_widget(SelectionScreen(name="profile_selection")) | ||
sm.add_widget(WinScreen()) | ||
sm.add_widget(LossScreen()) | ||
# sm.add_widget(PostSelectionScreen(name="post_selection_screen")) | ||
return sm | ||
|
||
|
||
if __name__ == "__main__": | ||
# calling run method of the application will build the widget tree, | ||
# and start the event loop. | ||
ResurgenceApp().run() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#:kivy 1.11.1 | ||
<OnboardingScreen>: | ||
canvas: | ||
Color: | ||
rgba: utils.get_color_from_hex('#321911') | ||
Rectangle: | ||
size: self.size | ||
MyOnboardWidget: | ||
id: my_onboard_widget | ||
Image: | ||
id: bg_img | ||
source: "onboarding/intro_img_crop.jpg" | ||
|
||
Label: | ||
id: app_name | ||
pos_hint: {"center_x": 0.50, "center_y": 0.8} | ||
text: "R E S U R G E N C E" | ||
font_size: "30sp" | ||
font_name: "delinquent-black-font/DelinquentCapsSkewdBlack-q2wq.ttf" | ||
color: utils.get_color_from_hex("#ff0000")#1, 0, 0, 1 | ||
Label: | ||
text: "Double tap to skip intro" | ||
pos_hint: {"center_x": 0.50, "center_y": 0.1} | ||
color: 1,1,1,0.5 | ||
# Label: | ||
# id: story_0 | ||
# pos_hint: {"center_x": 0.50, "center_y": 0.5} | ||
# text: "It's the year 12020 CE.... It's the year 12020 CE... It's the year 12020 CE..." | ||
# font_size: "35sp" | ||
# text_size: (self.width,None) | ||
# font_name: "delinquent-black-font/DelinquentExtract-V4we.ttf" | ||
# color: 1, 1, 1, 1 | ||
# opacity: 0 | ||
# halign: "center" | ||
# | ||
# Label: | ||
# id: story_1 | ||
# pos_hint: {"center_x": 0.50, "center_y": 0.5} | ||
# text: "Civilization" | ||
# font_size: "35sp" | ||
# font_name: "delinquent-black-font/DelinquentExtract-V4we.ttf" | ||
# color: utils.get_color_from_hex("#ff0000")#1, 0, 0, 1 | ||
# opacity: 0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
from kivy.app import App | ||
from kivy.uix.label import Label | ||
from kivy.uix.floatlayout import FloatLayout | ||
from kivy.uix.screenmanager import ScreenManager, Screen | ||
from kivy.animation import Animation | ||
from kivy.clock import Clock | ||
from functools import partial | ||
|
||
lorem = "" | ||
sentences = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strings in this list are unclear and it is hard to understand at first glance, maybe should have been put into a text document or something. |
||
"It's the year 12020 CE...", | ||
"""Civilization has fallen, after the humans caused their own demise as they tried to""" | ||
""" interfere with the natural order of things thousands of years ago """, | ||
"""Experiments with the prehistoric animal DNA, race to the ultimate doomsday""" | ||
""" weapon and the total neglect of Global Warming...""", | ||
"Today, flora and fauna from all ages flourish, treading the ruins of an ancient civilization.", | ||
"""Some humans survived against all odds, striving to rebuild what was lost,""" | ||
""" but without lost knowledge and wisdom it seems hopeless.""", | ||
"""You are one of these humans. Will you be the one, cunning and smart enough to tip""" | ||
""" the scales or will your ignorant careless attitude ruin everything?""", | ||
"Only time will tell.", | ||
] | ||
# images = [ | ||
# "https://placekitten.com/g/1080/1920", | ||
# "https://placekitten.com/g/200/300", | ||
# "https://placekitten.com/g/300/400", | ||
# ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kitten URLs? This commented out code should be removed. |
||
|
||
images = ["onboarding/intro_img_crop.jpg"] | ||
|
||
|
||
class MyOnboardWidget(FloatLayout): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class needs a docstring. |
||
steps = 0 | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
self.steps = 0 | ||
# for index, image_url in enumerate(images): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented out code should not be left in. |
||
# image_object = AsyncImage(source=image_url, size_hint=(1, 1)) | ||
# image_object.opacity = 1 if index == 0 else 0 | ||
# setattr(self, f"image_{index}", image_object) | ||
# self.add_widget(image_object) | ||
|
||
for index, sentence in enumerate(sentences): | ||
label_object = Label( | ||
text=sentence, | ||
text_size=(self.width * 4, None), | ||
pos_hint={"center_x": 0.50, "center_y": 0.5}, | ||
color=[1, 1, 1, 1], | ||
valign="center", | ||
# align="middle", | ||
font_size="35sp", | ||
font_name="delinquent-black-font/DelinquentExtract-V4we.ttf", | ||
# text_size=(400, 600), | ||
) | ||
# label_object.opacity = 1 if index == 0 else 0 | ||
label_object.opacity = 0 | ||
setattr(self, f"description_{index}", label_object) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A dictionary should be used here to store your labels, or a list, not class attributes. |
||
self.add_widget(label_object) | ||
|
||
def animate(self, obj_out, obj_in, opacity, *args): | ||
appear = Animation(opacity=1, duration=1) | ||
disappear = Animation(opacity=opacity, duration=1) | ||
appear.start(obj_in) | ||
disappear.start(obj_out) | ||
|
||
def on_touch_down(self, touch): | ||
if self.steps == 0: | ||
Clock.schedule_once( | ||
partial( | ||
self.animate, self.parent.ids["bg_img"], getattr(self, f"description_0"), 0.2 | ||
), | ||
0.5 + 0 * 5, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sum confuses me, 0 * 5? |
||
) | ||
speed = 15 | ||
delay = len(sentences[0]) / speed + 1 | ||
for index, sentence in enumerate(sentences[1:], start=1): | ||
# print(index, sentence) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debug print statements should be removed, commenting out is not removal. |
||
# print(getattr(self, f"description_{index - 1}")) | ||
# print(getattr(self, f"description_{index}")) | ||
|
||
Clock.schedule_once( | ||
partial( | ||
self.animate, | ||
getattr(self, f"description_{index-1}"), | ||
getattr(self, f"description_{index}"), | ||
0, | ||
), | ||
1 + delay, | ||
) | ||
delay += len(sentence) / speed | ||
if touch.is_double_tap: | ||
self.parent.manager.current = "create_profile" | ||
|
||
self.steps += 1 | ||
|
||
return True | ||
|
||
|
||
class OnboardingScreen(Screen): | ||
pass | ||
|
||
|
||
class CreateProfileTest(Screen): | ||
pass | ||
|
||
|
||
class OnboardingApp(App): | ||
def build(self): | ||
sm = ScreenManager() | ||
sm.add_widget(OnboardingScreen(name="onboarding")) | ||
sm.add_widget(CreateProfileTest(name="create_profile")) | ||
return sm | ||
|
||
|
||
if __name__ == "__main__": | ||
OnboardingApp().run() | ||
|
||
|
||
# def ola(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be removed. |
||
# print("HELLLOOO") | ||
# | ||
# | ||
# class CarouselApp(App): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example testing code should not be committed or left in. |
||
# def build(self): | ||
# # carousel = Carousel(direction="right", loop=True) | ||
# # src = "https://placekitten.com/g/1080/1920" | ||
# # src_1 = "https://placekitten.com/g/1080/1920" | ||
# # image = AsyncImage(source=src) | ||
# # image1 = AsyncImage(source=src_1) | ||
# # carousel.add_widget(image) | ||
# # carousel.add_widget(image1) | ||
# # return carousel | ||
# | ||
# | ||
# CarouselApp().run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never used as far as I can see.