diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-09 16:37:37 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-09 16:37:37 (GMT) |
commit | 421a9648767f8de54cf2b9460aaf15d754f5dccd (patch) | |
tree | b4b533269069bc3245b3be21869e6789a00de006 /demos/mobile/quickhit/plugins | |
parent | 19a485bd205690561b91d6bdf4c2e5310511d075 (diff) | |
download | Qt-421a9648767f8de54cf2b9460aaf15d754f5dccd.zip Qt-421a9648767f8de54cf2b9460aaf15d754f5dccd.tar.gz Qt-421a9648767f8de54cf2b9460aaf15d754f5dccd.tar.bz2 |
Adding quickhit and guitartuner mobile demos.
Diffstat (limited to 'demos/mobile/quickhit/plugins')
90 files changed, 2285 insertions, 0 deletions
diff --git a/demos/mobile/quickhit/plugins/LevelOne/Level.qml b/demos/mobile/quickhit/plugins/LevelOne/Level.qml new file mode 100644 index 0000000..d564e6e --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/Level.qml @@ -0,0 +1,214 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +Rectangle { + id: enemies + anchors.fill: parent + color: "black" + + + // Background image for the level + Image { + id: background1 + source: "file:/"+LevelPlugin.pictureRootPath()+"background3.png" + fillMode: Image.PreserveAspectCrop + smooth: true + //anchors.fill: parent + width: parent.width + height: parent.height + } + + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + function pause(doPause) { + if (doPause) { + rightLeftAnim.pause() + upToDownAnim.pause() + } else { + rightLeftAnim.resume() + upToDownAnim.resume() + } + } + + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + objectName: "level" + + property int enemySpeed: LevelPlugin.enemySpeed() + property int enemyMaxWidth + + // Create enemies dynamically + function createEnemies(amount) { + var b = false; + for (var i=0;i<amount;i++) { + if (b){ + Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png";}',enemiesGrid); + } else { + Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy2.png";}',enemiesGrid); + } + b = !b; + } + } + + // Calculate enemy max width + function calEnemyMaxWidth() { + var enemyCountInCol = LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount(); + enemyCountInCol++; // add some extra space needs for width + if (enemyCountInCol*LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width > gameArea.width) { + enemyMaxWidth = gameArea.width / (enemyCountInCol + 1); + } + else { + enemyMaxWidth = LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width; + } + } + + + Component.onCompleted: { + // Calculate enemy max width + calEnemyMaxWidth() + + // Create enemies dynamically after component created + createEnemies(LevelPlugin.enemyCount()) + + // Start animations + enemiesGrid.y = enemiesGrid.height * -1 + rightLeftAnim.restart() + upToDownAnim.restart() + + // Flying stars animation, not in Maemo + if (!GameEngine.isMaemo()) { + starBurstTimer.restart() + } + + GameEngine.playSound(4) // NOTE: Level start sound + } + + + Timer { + id: starBurstTimer + interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true + onTriggered: { + starParticles.burst(GameEngine.randInt(4,10)) + } + } + + + // Right-left animation + SequentialAnimation { + id: rightLeftAnim + loops: Animation.Infinite + NumberAnimation { target:enemiesGrid; property:"x"; from: 0; to:gameArea.width - enemiesGrid.width; easing.type: Easing.OutQuad; duration: 3000 } + NumberAnimation { target:enemiesGrid; property:"x"; to: 0; easing.type: Easing.OutQuad; duration: 3000 } + } + + // Up to down animation + PropertyAnimation { id: upToDownAnim; target:enemiesGrid; property:"y"; to: gameArea.height; + easing.type: Easing.Linear; duration: enemies.enemySpeed } + + Grid { + id: enemiesGrid + objectName: "enemiesGrid" + columns: LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount() + spacing: 8 + } + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Execute explode particle effect + function explode(x,y) { + explodeParticles.x = x + explodeParticles.y = y + explodeParticles.burst(20) + explodeParticles.opacity = 1 + } + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Explode particle effect + Particles { + id: explodeParticles + opacity: 0 + width: 1 + height: 1 + emissionRate: 0 + source: "file:/"+LevelPlugin.pictureRootPath()+"red_fire.png" + lifeSpan: 500 + lifeSpanDeviation: 2000 + count: -1 + angle: 270 + angleDeviation: 65 + velocity: 100 + velocityDeviation: 100 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 300 + acceleration: 50 + } + } + + Particles { + id: starParticles + y: -50 + x: 0 + width: parent.width + height: 50 + emissionRate: 0 + source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png" + lifeSpan: 3000 + count: -1 + angle: 90 + velocity: 100 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 500 + } + } + + +} + + + + + diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/changelog b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog new file mode 100644 index 0000000..de7ac98 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog @@ -0,0 +1,11 @@ +levelone (1.1.0) unstable; urgency=low + + * Final graphics + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200 + +levelone (1.0.0) unstable; urgency=low + + * First version + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200 diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/compat b/demos/mobile/quickhit/plugins/LevelOne/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/compat @@ -0,0 +1 @@ +7 diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/control b/demos/mobile/quickhit/plugins/LevelOne/debian/control new file mode 100644 index 0000000..c46afef --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/control @@ -0,0 +1,11 @@ +Source: levelone +Section: user/games +Priority: extra +Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com> +Standards-Version: 3.7.2 + +Package: levelone +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: QuickHit - LevelOne + QuickHit - LevelOne diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/copyright b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright new file mode 100644 index 0000000..fb9e5a8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright @@ -0,0 +1,8 @@ +This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com> +on Tue, 19 Oct 2010 10:05:04 +0200 + + +Copyright Holder: Nokia (c) 2010 + +License: + diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/dirs b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs new file mode 100644 index 0000000..80507f1 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/applications/hildon diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/postinst b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst new file mode 100644 index 0000000..79fb6dd --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst @@ -0,0 +1,5 @@ +#!/bin/sh -e + +gtk-update-icon-cache -f /usr/share/icons/hicolor + +exit 0 diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/rules b/demos/mobile/quickhit/plugins/LevelOne/debian/rules new file mode 100644 index 0000000..53a1d2e --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +APPNAME := levelone + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/$(APPNAME). + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + # dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png Binary files differnew file mode 100644 index 0000000..c81875a --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png Binary files differnew file mode 100644 index 0000000..94f149b --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png Binary files differnew file mode 100644 index 0000000..448f8ca --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png Binary files differnew file mode 100644 index 0000000..c0b28d8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png Binary files differnew file mode 100644 index 0000000..8401034 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png Binary files differnew file mode 100644 index 0000000..139aa61 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png Binary files differnew file mode 100644 index 0000000..dacd610 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png Binary files differnew file mode 100644 index 0000000..464d603 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png Binary files differnew file mode 100644 index 0000000..cb7851c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png Binary files differnew file mode 100644 index 0000000..f37a391 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png Binary files differnew file mode 100644 index 0000000..3aa1e41 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp new file mode 100644 index 0000000..a3aa1f6 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "levelone.h" +#include <QtCore/qplugin.h> + + +LevelOne::LevelOne() +{ +} + +LevelOne::~LevelOne() +{ +} + +QString LevelOne::pathPrefix() +{ + /* +QDir::rootPath() +For Unix operating systems this returns "/". +For Windows file systems this normally returns "c:/". +On Symbian this typically returns "c:/data", +*/ + +#ifdef Q_WS_MAEMO_5 + return "/home/user/."; +#elif defined Q_OS_WIN32 + return QDir::rootPath(); +#else + //return QDir::rootPath()+"/"; + return "c:/System/"; +#endif +} + +QStringList LevelOne::levelSounds() +{ + QStringList list; + + // NOTE: Mandatory sounds/indexs for the all levels + // 0 = Enemy explode + list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav"); + // 1 = You explode + list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/crash.wav"); + // 2 = Missile fires + list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav"); + // 3 = Emeny Missile fires + list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket.wav"); + + // Additional sounds + // Level starts + list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/levelonestart.wav"); + + return list; +} + +QVariant LevelOne::getData(QVariant key) +{ + QVariant ret; + switch (key.toInt()) { + case 1: { + // Any data what you need for this key + // Set your data into QVariant (ret) + break; + } + default: { + break; + } + } + return ret; +} + +QVariant LevelOne::graphSize(QVariant pathToGraph) +{ + QVariant ret; + m_imageReader.setFileName(pathToGraph.toString()); + QSize imageSize = m_imageReader.size(); + ret.setValue(imageSize); + return ret; +} + +// This Qt macro exports the plugin class LevelOne with the name levelplugins. +// There should be exactly one occurrence of this LevelOne macro in a Qt plugin's source code. +Q_EXPORT_PLUGIN2(levelplugins, LevelOne); diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.h b/demos/mobile/quickhit/plugins/LevelOne/levelone.h new file mode 100644 index 0000000..6c64d79 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LEVELONE_H +#define LEVELONE_H + +#include <QObject> +#include <QDir> +#include <QImageReader> + +#include "levelplugininterface.h" + +class LevelOne : public LevelPluginInterface +{ + Q_OBJECT + + // This macro tells Qt which interfaces the class implements. + // This is used when implementing plugins. + Q_INTERFACES(LevelPluginInterface) + +public: + LevelOne(); + ~LevelOne(); + + static QString pathPrefix(); + +public: // From LevelPluginInterface + + QStringList levelSounds(); + + Q_INVOKABLE QVariant getData(QVariant key); + + Q_INVOKABLE QVariant graphSize(QVariant pathToGraph); + + Q_INVOKABLE QVariant enemyCount() { return QVariant(30); } // 6x5=30 + Q_INVOKABLE QVariant enemyRowCount() { return QVariant(6); } // 6 rows of enemies + Q_INVOKABLE QVariant enemySpeed() { return QVariant(36000); } + Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(200); } + + // Root paths for the QML, Pictures and Sounds + Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/"); } + Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/"); } + + // Full paths + Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/transparent.png");} + Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/missile2.png");} + Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/enemy_missile2.png");} + Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/ship.png");} + +protected: + QImageReader m_imageReader; +}; + +#endif // LEVELONE_H diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro new file mode 100644 index 0000000..fcbfc56 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro @@ -0,0 +1,100 @@ + +# Copyright (c) 2010 Nokia Corporation. + +TEMPLATE = lib + +#VERSION = 1.1.0 + +CONFIG += plugin + +INCLUDEPATH += ../ + +HEADERS = levelone.h + +SOURCES = levelone.cpp + +TARGET = $$qtLibraryTarget(levelone) + +OTHER_FILES += Level.qml + + +# SYMBIAN --------------------------- +symbian: { +# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files +load(data_caging_paths) + +# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data +TARGET.EPOCALLOWDLLDATA=1 +TARGET.UID3 = 0xE07dfb66 + +TARGET.CAPABILITY = NetworkServices \ + Location \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment + +# Defines plugin stub file into Symbian .pkg package +pluginDep.sources = levelone.dll +pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels +DEPLOYMENT += pluginDep + +# Graphics and Sounds for the plugin +BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/background3.png" \ +"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ +"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \ +"gfx/red_fire.png ../winscw/c/Data/gfx/red_fire.png" \ +"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \ +"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \ +"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \ +"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \ +"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \ +"sound/crash.wav ../winscw/c/Data/sound/crash.wav" \ +"sound/rocket.wav ../winscw/c/Data/sound/rocket.wav" \ +"sound/rocket_explosion.wav ../winscw/c/Data/sound/rocket_explosion.wav" \ +"sound/levelonestart.wav ../winscw/c/Data/sound/levelonestart.wav" \ +"Level.qml ../winscw/c/Data/Level.qml" + + +myQml.sources = level.qml +myQml.path = c:/System/quickhitdata/levelone +myGraphic.sources = gfx/* +myGraphic.path = c:/System/quickhitdata/levelone/gfx +mySound.sources = sound/* +mySound.path = c:/System/quickhitdata/levelone/sound +# Takes qml, graphics and sounds into Symbian SIS package file (.pkg) +DEPLOYMENT += myQml myGraphic mySound + +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +# Installs binaries +INSTALLS += target +} + +# WINDOWS --------------------------- +win32: { +# Copy level sounds and graphics into right destination +system(mkdir c:\\quickhitdata\\levelone) +system(mkdir c:\\quickhitdata\\levelone\\gfx) +system(mkdir c:\\quickhitdata\\levelone\\sound) +system(copy *.qml c:\\quickhitdata\\levelone) +system(copy gfx\\*.* c:\\quickhitdata\\levelone\\gfx) +system(copy sound\\*.* c:\\quickhitdata\\levelone\\sound) + +# Installs binaries +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +INSTALLS += target +} + +# MAEMO_5 --------------------------- +maemo5: { +myQml.path = /home/user/.quickhitdata/levelone/ +myQml.files += Level.qml +myGraphic.path = /home/user/.quickhitdata/levelone/gfx/ +myGraphic.files += gfx/* +mySound.path = /home/user/.quickhitdata/levelone/sound/ +mySound.files += sound/* + +target.path += /usr/lib/qt4/plugins/quickhitlevels +# Installs qml, binaries, sounds and graphics +INSTALLS += target myGraphic mySound myQml +} diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav Binary files differnew file mode 100644 index 0000000..8076f0f --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav Binary files differnew file mode 100644 index 0000000..e9e3ac0 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav Binary files differnew file mode 100644 index 0000000..8c0dee9 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav Binary files differnew file mode 100644 index 0000000..d2b451c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog new file mode 100644 index 0000000..a5e0a1b --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog @@ -0,0 +1,11 @@ +leveltemplate (1.1.0) unstable; urgency=low + + * Final graphics + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200 + +leveltemplate (1.0.0) unstable; urgency=low + + * First version + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200 diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat @@ -0,0 +1 @@ +7 diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/control b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control new file mode 100644 index 0000000..68742fd --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control @@ -0,0 +1,11 @@ +Source: leveltemplate +Section: user/games +Priority: extra +Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com> +Standards-Version: 3.7.2 + +Package: leveltemplate +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: QuickHit - Level Template + QuickHit - Level Template diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright new file mode 100644 index 0000000..f9ee8e2 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright @@ -0,0 +1,8 @@ +This is leveltemplate, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com> +on Tue, 19 Oct 2010 10:05:04 +0200 + + +Copyright Holder: Nokia (c) 2010 + +License: + diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs new file mode 100644 index 0000000..80507f1 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/applications/hildon diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist new file mode 100644 index 0000000..f3146fa1 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist @@ -0,0 +1,41 @@ +755 root root . home / +755 root root . home/maemo / +755 root root . home/maemo/quickhitdata / +755 root root . home/maemo/quickhitdata/levelone / +644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml +755 root root . home/maemo/quickhitdata/leveltwo / +755 root root . home/maemo/quickhitdata/leveltwo/gfx / +644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png +755 root root . home/maemo/quickhitdata/leveltwo/sound / +644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav +755 root root . usr / +755 root root . usr/bin / +755 root root . usr/lib / +755 root root . usr/lib/qt4 / +755 root root . usr/lib/qt4/plugins / +755 root root . usr/lib/qt4/plugins/quickhitlevels / +644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so +755 root root . usr/share / +755 root root . usr/share/applications / +755 root root . usr/share/applications/hildon / +755 root root . usr/share/doc / +755 root root . usr/share/doc/levelone / +644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz +644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst new file mode 100644 index 0000000..79fb6dd --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst @@ -0,0 +1,5 @@ +#!/bin/sh -e + +gtk-update-icon-cache -f /usr/share/icons/hicolor + +exit 0 diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules new file mode 100644 index 0000000..7f30ca3 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +APPNAME := leveltemplate + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/$(APPNAME). + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + # dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png Binary files differnew file mode 100644 index 0000000..8667a39 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png Binary files differnew file mode 100644 index 0000000..94f149b --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png Binary files differnew file mode 100644 index 0000000..448f8ca --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png Binary files differnew file mode 100644 index 0000000..c0b28d8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png Binary files differnew file mode 100644 index 0000000..dacd610 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png Binary files differnew file mode 100644 index 0000000..cb7851c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png Binary files differnew file mode 100644 index 0000000..3aa1e41 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp new file mode 100644 index 0000000..fffec69 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "leveltemplate.h" +#include <QtCore/qplugin.h> + + +LevelTemplate::LevelTemplate() +{ +} + +LevelTemplate::~LevelTemplate() +{ +} + +QString LevelTemplate::pathPrefix() +{ +/* +QDir::rootPath() +For Unix operating systems this returns "/". +For Windows file systems this normally returns "c:/". +On Symbian this typically returns "c:/data", +*/ + +#ifdef Q_WS_MAEMO_5 + return "/home/user/."; +#elif defined Q_OS_WIN32 + return QDir::rootPath(); +#else + //return QDir::rootPath()+"/"; + return "c:/System/"; +#endif +} + +QStringList LevelTemplate::levelSounds() +{ + QStringList list; + + + // NOTE: Mandatory sounds/indexs for the all levels + // 0 = Enemy explode + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enemy_explosion.wav"); + // 1 = You explode + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/myship_explosion.wav"); + // 2 = Missile fires + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/laser.wav"); + // 3 = Emeny Missile fires + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/rocket.wav"); + + // Additional sounds + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enableship.wav"); + list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/level2.wav"); + + + return list; +} + +QVariant LevelTemplate::getData(QVariant key) +{ + QVariant ret; + switch (key.toInt()) { + case 1: { + // Any data what you need for this key + // Set your data into QVariant (ret) + break; + } + default: { + break; + } + } + return ret; +} + +QVariant LevelTemplate::graphSize(QVariant pathToGraph) +{ + QVariant ret; + m_imageReader.setFileName(pathToGraph.toString()); + QSize imageSize = m_imageReader.size(); + ret.setValue(imageSize); + return ret; +} + +// This Qt macro exports the plugin class level with the name levelplugins. +// There should be exactly one occurrence of this macro in a Qt plugin's source code. +Q_EXPORT_PLUGIN2(levelplugins, LevelTemplate); + + + + diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h new file mode 100644 index 0000000..f13705a --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LevelTemplate_H +#define LevelTemplate_H + +#include <QObject> +#include <QDir> +#include <QImageReader> + +// Common interface header for all level plugins +#include "levelplugininterface.h" + +// Level name +#define LEVEL_NAME "leveltemplate" + +class LevelTemplate : public LevelPluginInterface +{ + Q_OBJECT + + // This macro tells Qt which interfaces the class implements. + // This is used when implementing plugins. + Q_INTERFACES(LevelPluginInterface) + +public: + LevelTemplate(); + ~LevelTemplate(); + + static QString pathPrefix(); + +public: // From LevelPluginInterface + + QStringList levelSounds(); + + Q_INVOKABLE QVariant getData(QVariant key); + + Q_INVOKABLE QVariant graphSize(QVariant pathToGraph); + + Q_INVOKABLE QVariant enemyCount() { return QVariant(1); } + Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); } + Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); } + Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(2000); } + + // Root paths for the QML, Pictures and Sounds + Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/"); } + Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/"); } + + // Full paths + Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/transparent.png");} + Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/missile2.png");} + Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/enemy_missile2.png");} + Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/ship.png");} + +protected: + QImageReader m_imageReader; +}; + +#endif // LevelTemplate_H diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro new file mode 100644 index 0000000..a4f5900 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro @@ -0,0 +1,103 @@ + +# Copyright (c) 2010 Nokia Corporation. + +TEMPLATE = lib + +#VERSION = 1.1.0 + +CONFIG += plugin + +INCLUDEPATH += ../ + +HEADERS = leveltemplate.h + +SOURCES = leveltemplate.cpp + +TARGET = $$qtLibraryTarget(leveltemplate) + +OTHER_FILES += qml/Level.qml \ + qml/Enemy.qml \ + qml/Level.js + + +# SYMBIAN --------------------------- +symbian: { +# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files +load(data_caging_paths) + +# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data +TARGET.EPOCALLOWDLLDATA=1 +TARGET.UID3 = 0xE07dfb68 + +TARGET.CAPABILITY = NetworkServices \ + Location \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment + +# Defines plugin stub file into Symbian .pkg package +pluginDep.sources = leveltemplate.dll +pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels +DEPLOYMENT += pluginDep + +# Graphics and Sounds for the plugin +BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ +"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \ +"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \ +"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \ +"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \ +"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \ +"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \ +"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \ +"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \ +"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \ +"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \ +"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \ +"qml/Level.qml ../winscw/c/Data/Level.qml" \ +"qml/Level.js ../winscw/c/Data/Level.js" \ +"qml/Enemy.qml ../winscw/c/Data/Enemy.qml" + + +myQml.sources = qml/* +myQml.path = c:/System/quickhitdata/leveltemplate +myGraphic.sources = gfx/* +myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx +mySound.sources = sound/* +mySound.path = c:/System/quickhitdata/leveltemplate/sound +# Takes qml, graphics and sounds into Symbian SIS package file (.pkg) +DEPLOYMENT += myQml myGraphic mySound + +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +# Installs binaries +INSTALLS += target +} + +# WINDOWS --------------------------- +win32: { +# Copy level sounds and graphics into right destination +system(mkdir c:\quickhitdata\leveltemplate) +system(mkdir c:\quickhitdata\leveltemplate\gfx) +system(mkdir c:\quickhitdata\leveltemplate\sound) +system(copy qml\*.* c:\quickhitdata\leveltemplate) +system(copy gfx\*.* c:\quickhitdata\leveltemplate\gfx) +system(copy sound\*.* c:\quickhitdata\leveltemplate\sound) + +# Installs binaries +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +INSTALLS += target +} + +# MAEMO_5 --------------------------- +maemo5: { +myQml.path = /home/user/.quickhitdata/leveltemplate/ +myQml.files += qml/* +myGraphic.path = /home/user/.quickhitdata/leveltemplate/gfx/ +myGraphic.files += gfx/* +mySound.path = /home/user/.quickhitdata/leveltemplate/sound/ +mySound.files += sound/* + +target.path += /usr/lib/qt4/plugins/quickhitlevels +# Installs qml, binaries, sounds and graphics +INSTALLS += target myGraphic mySound myQml +} diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml new file mode 100644 index 0000000..b187c03 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: enemy + + // *************************************************** + // *** NOTE: This "enemy "is mandatory enemy object name for all enemy QML files + objectName: "enemy" + + smooth:true + opacity: 0 // 0=hidden by default + fillMode:Image.PreserveAspectFit + source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png" + + property int enemySpeed: LevelPlugin.enemySpeed() + + // *************************************************** + // *** NOTE: This "pause(bool)" function is mandatory for all enemies QML files + function pause(doPause) { + } +} diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js new file mode 100644 index 0000000..e2e1d3a --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +var hiddenEnemies = new Array() + diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml new file mode 100644 index 0000000..3a383cf --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +// Level own JavaScript file +import "Level.js" as LevelScript + +Rectangle { + id: enemies + anchors.fill: parent + property int enemiesCreated: 0 + property int enemiesEnabled: 0 + color: "black" + + // *************************************************** + // *** NOTE: This "pause(bool)" function is mandatory for all level QML files + function pause(doPause) { + } + + // *************************************************** + // *** NOTE: Level object name "level" is mandatory for all level QML files + objectName: "level" + + // Enemy placeholder. Have to exist at least one enemy for prevent to level be stopped + Enemy { + x: parent.width / 2 + y: parent.height / 2 + opacity: 1 + } + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Execute explode particle effect + function explode(x,y) { + explodeParticles.x = x + explodeParticles.y = y + explodeParticles.burst(20) + explodeParticles.opacity = 1 + } + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Explode particle effect + Particles { + id: explodeParticles + opacity: 0 + width: 1 + height: 1 + emissionRate: 0 + source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png" + lifeSpan: 500 + lifeSpanDeviation: 2000 + count: -1 + angle: 270 + angleDeviation: 65 + velocity: 100 + velocityDeviation: 100 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 300 + acceleration: 50 + } + } +} diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav Binary files differnew file mode 100644 index 0000000..8076f0f --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav Binary files differnew file mode 100644 index 0000000..6fe5fe8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav Binary files differnew file mode 100644 index 0000000..fd338e6 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav Binary files differnew file mode 100644 index 0000000..c3b58b2 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav Binary files differnew file mode 100644 index 0000000..24d3917 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav Binary files differnew file mode 100644 index 0000000..e22d030 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav Binary files differnew file mode 100644 index 0000000..8c0dee9 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav Binary files differnew file mode 100644 index 0000000..d2b451c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog new file mode 100644 index 0000000..106ef66 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog @@ -0,0 +1,11 @@ +leveltwo (1.1.0) unstable; urgency=low + + * Final graphics + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200 + +leveltwo (1.0.0) unstable; urgency=low + + * First version + + -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200 diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/compat b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat @@ -0,0 +1 @@ +7 diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/control b/demos/mobile/quickhit/plugins/LevelTwo/debian/control new file mode 100644 index 0000000..8f9d05e --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/control @@ -0,0 +1,11 @@ +Source: leveltwo +Section: user/games +Priority: extra +Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com> +Standards-Version: 3.7.2 + +Package: leveltwo +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: QuickHit - LevelTwo + QuickHit - LevelTwo diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright new file mode 100644 index 0000000..fb9e5a8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright @@ -0,0 +1,8 @@ +This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com> +on Tue, 19 Oct 2010 10:05:04 +0200 + + +Copyright Holder: Nokia (c) 2010 + +License: + diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs new file mode 100644 index 0000000..80507f1 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/applications/hildon diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist new file mode 100644 index 0000000..f3146fa1 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist @@ -0,0 +1,41 @@ +755 root root . home / +755 root root . home/maemo / +755 root root . home/maemo/quickhitdata / +755 root root . home/maemo/quickhitdata/levelone / +644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml +755 root root . home/maemo/quickhitdata/leveltwo / +755 root root . home/maemo/quickhitdata/leveltwo/gfx / +644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png +644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png +755 root root . home/maemo/quickhitdata/leveltwo/sound / +644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav +644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav +755 root root . usr / +755 root root . usr/bin / +755 root root . usr/lib / +755 root root . usr/lib/qt4 / +755 root root . usr/lib/qt4/plugins / +755 root root . usr/lib/qt4/plugins/quickhitlevels / +644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so +755 root root . usr/share / +755 root root . usr/share/applications / +755 root root . usr/share/applications/hildon / +755 root root . usr/share/doc / +755 root root . usr/share/doc/levelone / +644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz +644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst new file mode 100644 index 0000000..79fb6dd --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst @@ -0,0 +1,5 @@ +#!/bin/sh -e + +gtk-update-icon-cache -f /usr/share/icons/hicolor + +exit 0 diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/rules b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules new file mode 100644 index 0000000..5dac6e0 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +APPNAME := leveltwo + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/$(APPNAME). + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + # dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png Binary files differnew file mode 100644 index 0000000..8fbf2f4 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png Binary files differnew file mode 100644 index 0000000..3a135d2 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png Binary files differnew file mode 100644 index 0000000..8667a39 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png Binary files differnew file mode 100644 index 0000000..94f149b --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png Binary files differnew file mode 100644 index 0000000..5011d75 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png Binary files differnew file mode 100644 index 0000000..8401034 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png Binary files differnew file mode 100644 index 0000000..139aa61 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png Binary files differnew file mode 100644 index 0000000..86bb41b --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png Binary files differnew file mode 100644 index 0000000..dacd610 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png Binary files differnew file mode 100644 index 0000000..cb7851c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png Binary files differnew file mode 100644 index 0000000..70af0f3 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png Binary files differnew file mode 100644 index 0000000..3aa1e41 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp new file mode 100644 index 0000000..45a39e3 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "leveltwo.h" +#include <QtCore/qplugin.h> + + +LevelTwo::LevelTwo() +{ +} + +LevelTwo::~LevelTwo() +{ +} + +QString LevelTwo::pathPrefix() +{ + /* +QDir::rootPath() +For Unix operating systems this returns "/". +For Windows file systems this normally returns "c:/". +On Symbian this typically returns "c:/data", +*/ + +#ifdef Q_WS_MAEMO_5 + return "/home/user/."; +#elif defined Q_OS_WIN32 + return QDir::rootPath(); +#else + //return QDir::rootPath()+"/"; + return "c:/System/"; +#endif +} + +QStringList LevelTwo::levelSounds() +{ + QStringList list; + + + // NOTE: Mandatory sounds/indexs for the all levels + // 0 = Enemy explode + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enemy_explosion.wav"); + // 1 = You explode + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/myship_explosion.wav"); + // 2 = Missile fires + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/laser.wav"); + // 3 = Emeny Missile fires + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/rocket.wav"); + + // Additional sounds + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enableship.wav"); + list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/level2.wav"); + + + return list; +} + +QVariant LevelTwo::getData(QVariant key) +{ + QVariant ret; + switch (key.toInt()) { + case 1: { + // Any data what you need for this key + // Set your data into QVariant (ret) + break; + } + default: { + break; + } + } + return ret; +} + +QVariant LevelTwo::graphSize(QVariant pathToGraph) +{ + QVariant ret; + m_imageReader.setFileName(pathToGraph.toString()); + QSize imageSize = m_imageReader.size(); + ret.setValue(imageSize); + return ret; +} + +// This Qt macro exports the plugin class LevelTwo with the name levelplugins. +// There should be exactly one occurrence of this LevelTwo macro in a Qt plugin's source code. +Q_EXPORT_PLUGIN2(levelplugins, LevelTwo); diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h new file mode 100644 index 0000000..b983210 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LevelTwo_H +#define LevelTwo_H + +#include <QObject> +#include <QDir> +#include <QImageReader> + +#include "levelplugininterface.h" + +class LevelTwo : public LevelPluginInterface +{ + Q_OBJECT + + // This macro tells Qt which interfaces the class implements. + // This is used when implementing plugins. + Q_INTERFACES(LevelPluginInterface) + +public: + LevelTwo(); + ~LevelTwo(); + + static QString pathPrefix(); + +public: // From LevelPluginInterface + + QStringList levelSounds(); + + Q_INVOKABLE QVariant getData(QVariant key); + + Q_INVOKABLE QVariant graphSize(QVariant pathToGraph); + + Q_INVOKABLE QVariant enemyCount() { return QVariant(35); } + Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); } + Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); } + Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(500); } + + // Root paths for the QML, Pictures and Sounds + Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/"); } + Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/"); } + + // Full paths + Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/transparent.png");} + Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/missile2.png");} + Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/enemy_missile2.png");} + Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/ship.png");} + +protected: + QImageReader m_imageReader; +}; + +#endif // LevelTwo_H diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro new file mode 100644 index 0000000..171ee6c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro @@ -0,0 +1,108 @@ + +# Copyright (c) 2010 Nokia Corporation. + +TEMPLATE = lib + +#VERSION = 1.1.0 + +CONFIG += plugin + +INCLUDEPATH += ../ + +HEADERS = leveltwo.h + +SOURCES = leveltwo.cpp + +TARGET = $$qtLibraryTarget(leveltwo) + +OTHER_FILES += qml/Level.qml \ + qml/Enemy.qml \ + qml/Level.js + + +# SYMBIAN --------------------------- +symbian: { +# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files +load(data_caging_paths) + +# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data +TARGET.EPOCALLOWDLLDATA=1 +TARGET.UID3 = 0xE07dfb67 + +TARGET.CAPABILITY = NetworkServices \ + Location \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment + +# Defines plugin stub file into Symbian .pkg package +pluginDep.sources = leveltwo.dll +pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels +DEPLOYMENT += pluginDep + +# Graphics and Sounds for the plugin +BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/background2.png" \ +"gfx/background_loop.png ../winscw/c/Data/gfx/background_loop.png" \ +"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ +"gfx/fire2.png ../winscw/c/Data/gfx/fire2.png" \ +"gfx/fire.png ../winscw/c/Data/gfx/fire.png" \ +"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \ +"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \ +"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \ +"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \ +"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \ +"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \ +"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \ +"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \ +"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \ +"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \ +"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \ +"qml/Level.qml ../winscw/c/Data/Level.qml" \ +"qml/Level.js ../winscw/c/Data/Level.js" \ +"qml/Enemy.qml ../winscw/c/Data/Enemy.qml" + + +myQml.sources = qml/* +myQml.path = c:/System/quickhitdata/leveltwo +myGraphic.sources = gfx/* +myGraphic.path = c:/System/quickhitdata/leveltwo/gfx +mySound.sources = sound/* +mySound.path = c:/System/quickhitdata/leveltwo/sound +# Takes qml, graphics and sounds into Symbian SIS package file (.pkg) +DEPLOYMENT += myQml myGraphic mySound + +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +# Installs binaries +INSTALLS += target +} + +# WINDOWS --------------------------- +win32: { + +# Copy level sounds and graphics into right destination +system(mkdir c:\quickhitdata\leveltwo) +system(mkdir c:\quickhitdata\leveltwo\gfx) +system(mkdir c:\quickhitdata\leveltwo\sound) +system(copy qml\*.* c:\quickhitdata\leveltwo) +system(copy gfx\*.* c:\quickhitdata\leveltwo\gfx) +system(copy sound\*.* c:\quickhitdata\leveltwo\sound) + +# Installs binaries +target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels +INSTALLS += target +} + +# MAEMO_5 --------------------------- +maemo5: { +myQml.path = /home/user/.quickhitdata/leveltwo/ +myQml.files += qml/* +myGraphic.path = /home/user/.quickhitdata/leveltwo/gfx/ +myGraphic.files += gfx/* +mySound.path = /home/user/.quickhitdata/leveltwo/sound/ +mySound.files += sound/* + +target.path += /usr/lib/qt4/plugins/quickhitlevels +# Installs qml, binaries, sounds and graphics +INSTALLS += target myGraphic mySound myQml +} diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml new file mode 100644 index 0000000..1b489b2 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: enemy + objectName: "enemy" + smooth:true + opacity: 0 // 0=hidden by default + fillMode:Image.PreserveAspectFit + source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png" + + property int enemySpeed: LevelPlugin.enemySpeed() + + function pause(doPause) { + if (doPause) { + upToDownAnim.pause() + rightLeftAnim.pause() + } else { + upToDownAnim.resume() + rightLeftAnim.resume() + } + } + + function startMovingAnim() { + upToDownAnim.restart() + rightLeftAnim.restart() + } + + // Right-left animation + SequentialAnimation { + id: rightLeftAnim + loops: Animation.Infinite + NumberAnimation { target:enemy; property:"x"; + to:gameArea.width - enemy.width; easing.type: Easing.OutQuad; duration: 3000 } + NumberAnimation { target:enemy; property:"x"; to:0; easing.type: Easing.OutQuad; duration: 3000 } + } + + // Up to down animation + SequentialAnimation { + id: upToDownAnim + PropertyAnimation { target:enemy; property:"y"; to: gameArea.height; + easing.type: Easing.Linear; duration: enemy.enemySpeed } + PropertyAction { target: enemy; properties: "opacity"; value: 0 } + } +} diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js new file mode 100644 index 0000000..e2e1d3a --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +var hiddenEnemies = new Array() + diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml new file mode 100644 index 0000000..69a6593 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml @@ -0,0 +1,228 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 +import "Level.js" as LevelScript + +Item { + id: enemies + anchors.fill: parent + + property int enemiesCreated: 0 + property int enemiesEnabled: 0 + + property int backOneTop + property int backTwoTop + + // Long background 2 + Image { + id: longBackground_2 + source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png" + fillMode: Image.Stretch + smooth: false + width: gameArea.width + height: gameArea.height + } + + // Long background 1 + Image { + id: longBackground_1 + source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png" + fillMode: Image.Stretch + smooth: false + width: gameArea.width + height: gameArea.height + } + + // Long background Up to down animation + ParallelAnimation { + id: backgroundAnim; + loops: Animation.Infinite + PropertyAnimation { target:longBackground_1; property:"y"; + from:backOneTop; to:gameArea.height; easing.type:Easing.Linear; duration:10000 } + PropertyAnimation { target:longBackground_2; property:"y"; + from:backTwoTop; to:backOneTop; easing.type:Easing.Linear; duration:10000 } + } + + + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + function pause(doPause) { + if (doPause) { + enemyCreationTimer.stop() + backgroundAnim.stop() + } else { + enemyCreationTimer.restart() + backgroundAnim.restart() + } + for (var i=0;i<LevelScript.hiddenEnemies.length;i++) { + var enemy = LevelScript.hiddenEnemies[i] + enemy.pause(doPause) + } + } + + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + objectName: "level" + + + // Enemy creation timer + Timer { + id: enemyCreationTimer + interval: 1000; running: false; repeat: true + onTriggered: { + enableEnemy() + } + } + + function enableEnemy() { + if (enemiesEnabled < enemiesCreated) { + var enemy = LevelScript.hiddenEnemies[enemiesEnabled] + enemy.opacity = 1 + enemy.x = GameEngine.randInt(0,gameArea.width-enemy.width-50) + enemy.startMovingAnim() + enemyCreationTimer.stop() + enemyCreationTimer.interval = GameEngine.randInt(500,2000) + enemyCreationTimer.restart() + enemiesEnabled = enemiesEnabled + 1 + GameEngine.playSound(4) // NOTE: Enable enemy sound + } else { + enemyCreationTimer.stop() + } + } + + // Hidden enemies group + function createHiddenEnemiesGroup() { + for (var i=0;i<LevelPlugin.enemyCount();i++) { + var enemyComponent = Qt.createComponent("file:/"+LevelPlugin.qmlRootPath()+"Enemy.qml") + var enemyObject = enemyComponent.createObject(enemies) + LevelScript.hiddenEnemies.push(enemyObject) + enemiesCreated = enemiesCreated + 1 + } + } + + Component.onCompleted: { + // Create hidden enemies + createHiddenEnemiesGroup() + // Flying moons animation + starBurstTimer.restart() + // Create enemies timer + enemyCreationTimer.restart() + + // Start Long background loop animation + backOneTop = 0 + longBackground_1.y = backOneTop; + backTwoTop = gameArea.height * -1 + longBackground_2.y = backTwoTop; + backgroundAnim.restart() + + GameEngine.playSounds(5,3) //NOTE: Level starts sound, 3 times + } + + Timer { + id: starBurstTimer + interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true + onTriggered: { + starParticles.burst(GameEngine.randInt(4,6)) + } + } + + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Execute explode particle effect + function explode(x,y) { + explodeParticles.x = x + explodeParticles.y = y + explodeParticles.burst(20) + explodeParticles.opacity = 1 + } + // *************************************************** + // *** NOTE: This is mandatory for all level QML files + // Explode particle effect + Particles { + id: explodeParticles + opacity: 0 + width: 1 + height: 1 + emissionRate: 0 + source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png" + lifeSpan: 500 + lifeSpanDeviation: 2000 + count: -1 + angle: 270 + angleDeviation: 65 + velocity: 100 + velocityDeviation: 100 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 300 + acceleration: 50 + } + } + + Particles { + id: starParticles + y: -50 + x: 0 + width: parent.width + height: 50 + emissionRate: 0 + source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png" + lifeSpan: 5000 + count: -1 + angle: 90 + velocity: 100 + opacity: 0.7 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 500 + } + } + + +} + + + + + diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav Binary files differnew file mode 100644 index 0000000..8076f0f --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav Binary files differnew file mode 100644 index 0000000..6fe5fe8 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav Binary files differnew file mode 100644 index 0000000..fd338e6 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav Binary files differnew file mode 100644 index 0000000..c3b58b2 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav Binary files differnew file mode 100644 index 0000000..24d3917 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav Binary files differnew file mode 100644 index 0000000..e22d030 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav Binary files differnew file mode 100644 index 0000000..8c0dee9 --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav Binary files differnew file mode 100644 index 0000000..d2b451c --- /dev/null +++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav diff --git a/demos/mobile/quickhit/plugins/levelplugininterface.h b/demos/mobile/quickhit/plugins/levelplugininterface.h new file mode 100644 index 0000000..b8d5018 --- /dev/null +++ b/demos/mobile/quickhit/plugins/levelplugininterface.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LEVELPLUGININTERFACE_H +#define LEVELPLUGININTERFACE_H + +#include <QObject> +#include <QVariant> + +class LevelPluginInterface : public QObject +{ +public: + // Full paths to level sounds + virtual QStringList levelSounds() = 0; + + // Generic key/value data + virtual QVariant getData(QVariant key) = 0; + + // Request picture size + virtual QVariant graphSize(QVariant pathToGraph) = 0; + + // Enemy count in the level + virtual QVariant enemyCount() = 0; + // Enemy row count in the level + virtual QVariant enemyRowCount() = 0; + // Enemy speed + virtual QVariant enemySpeed() = 0; + // Enemy fire speed + virtual QVariant enemyFireSpeed() = 0; + + // QML root path + virtual QVariant qmlRootPath() = 0; + // Picture root path + virtual QVariant pictureRootPath() = 0; + + // Paths for GameEngine and QuickHit internal QML files + virtual QVariant pathToTransparentEnemyPic() = 0; + virtual QVariant pathToMissilePic() = 0; + virtual QVariant pathToEnemyMissilePic() = 0; + virtual QVariant pathToMyShipPic() = 0; +}; + +// This Qt macro associates the given Identifier "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0" +// to the interface class called LevelPluginInterface. The Identifier must be unique. +Q_DECLARE_INTERFACE(LevelPluginInterface, + "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0"); + + +#endif // LEVELPLUGININTERFACE_H |