Skip to content

Commit

Permalink
Importing files
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoTheThird committed Jun 4, 2017
1 parent 866943d commit 0c7b5ff
Show file tree
Hide file tree
Showing 13 changed files with 1,133 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
6 changes: 6 additions & 0 deletions 8192.apparmor
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"policy_groups": [
"networking"
],
"policy_version": 1.3
}
7 changes: 7 additions & 0 deletions 8192.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
_Name=8192
Exec=qmlscene qml/Main.qml
Icon=assets/logo.png
Terminal=false
Type=Application
X-Ubuntu-Touch=true
61 changes: 61 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
project(8192 C CXX)
cmake_minimum_required(VERSION 3.0.0)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(Qt5Core)
find_package(Qt5Qml)
find_package(Qt5Quick)

# Automatically create moc files
set(CMAKE_AUTOMOC ON)

# Components PATH
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
OUTPUT_VARIABLE ARCH_TRIPLET
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")

set(PROJECT_NAME "8192")
set(CMAKE_INSTALL_PREFIX /)
set(DATA_DIR /)
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)

# This command figures out the target architecture for use in the manifest file
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_ARCH
OUTPUT_VARIABLE CLICK_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
install(DIRECTORY qml DESTINATION ${DATA_DIR})
install(DIRECTORY assets DESTINATION ${DATA_DIR})

# Translations
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h)

find_program(INTLTOOL_MERGE intltool-merge)
if(NOT INTLTOOL_MERGE)
message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
endif()
find_program(INTLTOOL_EXTRACT intltool-extract)
if(NOT INTLTOOL_EXTRACT)
message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
endif()

add_custom_target(${DESKTOP_FILE_NAME} ALL
COMMENT "Merging translations into ${DESKTOP_FILE_NAME}..."
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_SOURCE_DIR}/${DESKTOP_FILE_NAME}.in ${DESKTOP_FILE_NAME}
COMMAND sed -i 's/${PROJECT_NAME}-//g' ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})

add_subdirectory(po)
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 8192

![8192](assets/logo.png)

A game. About squares. Yeah. I know.
Written in QML for [Ubuntu Touch](https://ubports.com) (Phone and Tablet).

## How to play

Swipe or use the arrow keys to join tiles with the same number. Avoid blockages to achieve the ultimate goal: The 8192 tile!

This game is a QML-rework of Gabriele Cirulli's game "2048", wich was inspired by Jason Saxon's game "1024!", wich was inspired by a board game called "Le 512", invented by King Louis XIV of France in 1657. But keep this in mind, this is important and there will be a test: The concept of "Le 512" was just stolen from a game called "Ye olde 256", played in the pubs of medieval London. Also, some sources state, that Pythagoras used to play a game that he called "128" with his students, wich looks back on the rich tradition of earlier Greek philosophers playing games like "64", "32", "16" and "8". Actually, "8" was just a more complex version of a game called "4", wich was very popular among greek High-School kids. It's not handed down if there is a connection, but archaeological findings show cave-paintings of Neanderthals playing a game, that recent scientific publications refer to as "2".

Yes, i know, the term over-forking does come to mind. But i just wanted to participate in the rich tradition of ripping of games about squares. But it's not all ripped of, i actually changed some of the code, you know, so that's really something. And it uses the Ubuntu Font and color scheme! Did you notice that, did anyone notice that? Wow, right? And what about this note, would you be reading this, if it was not for me? No, you most certainly would not!

## Here's what the press has to say:

10/10 - "Would play again!" - not IGN
11/10 - "I really like the font and color scheme!" - not Mark Shuttleworth
0/10 - "I already got an app for that" - Any person on the street
3/10 - "I think I've seen this before" - still not IGN
10/10 - "Your best game so far." - My sister

## How to build

Set up [clickable](https://github.com/bhdouglass/clickable) and run `clickable` inside the working directory.

## Thank you!

A big thanks to Gabriele Cirulli and Jason Saxon for letting me rip off their work. Thanks to Brian Douglass for Clickable. Thanks to the original Creators of Ubuntu Touch, the Ubuntu SDK and the Ubuntu UI toolkit. Thank you to everybody who helps keeping [Ubuntu Touch](https://ubports.com) alive.

## Barely legal Legal Notice

Any who, if you want to be the person to create "16384", go ahead and do so! It's all GPL Licensed, so what's taking you so long? Create that fork! You know you want it!

Well, that escalated quickly. Actually, i just wanted to write a short note about how this game was not actually created by me, and now there is this huge novel. Anyways, have Fun playing and buy the original authors some coffee (or beer, whichever they prefer) if you see them!

Copyright (C) 2017 Jan Jakob Sprinz aka. NeoTheThird
110 changes: 110 additions & 0 deletions assets/8192.svg
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/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions clickable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"template": "cmake",
"kill": "qmlscene"
}
15 changes: 15 additions & 0 deletions manifest.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "8192.neothethird",
"description": "A game. About squares.",
"architecture": "@CLICK_ARCH@",
"title": "8192",
"hooks": {
"8192": {
"apparmor": "8192.apparmor",
"desktop": "8192.desktop"
}
},
"version": "0.1",
"maintainer": "Jan Sprinz <[email protected]>",
"framework" : "ubuntu-sdk-15.04.7"
}
104 changes: 104 additions & 0 deletions po/8192.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 8192\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-04 17:31+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../qml/Main.qml:79
msgid "Welcome to 8192"
msgstr ""

#: ../qml/Main.qml:123
msgid "YOUR SCORE"
msgstr ""

#: ../qml/Main.qml:129
msgid "HIGHSCORE"
msgstr ""

#: ../qml/Main.qml:160 ../qml/Main.qml:195 ../qml/Main.qml:228
#: ../qml/Main.qml:248
msgid "Restart"
msgstr ""

#: ../qml/Main.qml:168
msgid "About"
msgstr ""

#: ../qml/Main.qml:196
msgid "Are you sure you want to restart the game?"
msgstr ""

#: ../qml/Main.qml:198
msgid "Yes"
msgstr ""

#: ../qml/Main.qml:205
msgid "No"
msgstr ""

#: ../qml/Main.qml:220
msgid "Victory"
msgstr ""

#: ../qml/Main.qml:222
msgid "Keep going"
msgstr ""

#: ../qml/Main.qml:244
msgid "Game over. :("
msgstr ""

#: ../qml/Main.qml:245
msgid "Score"
msgstr ""

#: ../qml/Main.qml:256
msgid "Quit"
msgstr ""

#: ../qml/Main.qml:272
msgid "8182"
msgstr ""

#: ../qml/Main.qml:273
msgid "<b>Version:</b> "
msgstr ""

#: ../qml/Main.qml:273
msgid ""
"<br><br>This game was shamelessly ripped of from Gabriele Cirulli's game "
"\"2048\", which was inspired by Jason Saxon's game \"1024!\". If you enjoy "
"this game and you ever happen to meet them, please consider treating them "
"for a decent cup of coffe, they really deserve it!<br><br><b>Copyright (c) "
"2017 Jan Sprinz<br>[email protected]</b>"
msgstr ""

#: ../qml/Main.qml:276
msgid "Donate"
msgstr ""

#: ../qml/Main.qml:283
msgid "Report a bug"
msgstr ""

#: ../qml/Main.qml:291
msgid "Close"
msgstr ""

#: 8192.desktop.in.h:1
msgid "8192"
msgstr ""
34 changes: 34 additions & 0 deletions po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
include(FindGettext)
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)

set(DOMAIN ${PROJECT_NAME})
set(POT_FILE ${DOMAIN}.pot)
file(GLOB PO_FILES *.po)

# Creates the .pot file containing the translations template
add_custom_target(${POT_FILE} ALL
COMMENT "Generating translation template"
COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
--srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_NAME}.in

COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
-D ${CMAKE_CURRENT_SOURCE_DIR}
-D ${CMAKE_CURRENT_BINARY_DIR}
--from-code=UTF-8
--c++ --qt --language=javascript --add-comments=TRANSLATORS
--keyword=tr --keyword=tr:1,2 --keyword=N_ --keyword=_
--package-name='${DOMAIN}'
${I18N_SRC_FILES}
COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR})

# Builds the binary translations catalog for each language
# it finds source translations (*.po) for
foreach(PO_FILE ${PO_FILES})
get_filename_component(LANG ${PO_FILE} NAME_WE)
gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
string(REPLACE ${PROJECT_NAME}- "" SHORT_LANG ${LANG})
set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/share/locale/${SHORT_LANG}/LC_MESSAGES)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
DESTINATION ${INSTALL_DIR}
RENAME ${DOMAIN}.mo)
endforeach(PO_FILE)
Loading

0 comments on commit 0c7b5ff

Please sign in to comment.