summaryrefslogtreecommitdiffstats
path: root/examples/mobile/quickhit/plugins/LevelOne
diff options
context:
space:
mode:
Diffstat (limited to 'examples/mobile/quickhit/plugins/LevelOne')
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/Level.qml215
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/changelog11
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/compat1
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/control11
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/copyright8
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/dirs2
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/postinst5
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/debian/rules91
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/background3.pngbin0 -> 113110 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/enemy2.pngbin0 -> 4344 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.pngbin0 -> 452 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/fire.pngbin0 -> 1036 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/fire2.pngbin0 -> 2558 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/red_fire.pngbin0 -> 4737 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/star3.pngbin0 -> 409 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/levelone.cpp117
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/levelone.h93
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/levelone.json1
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/levelone.pro97
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wavbin0 -> 500528 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--examples/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wavbin0 -> 289420 bytes
27 files changed, 652 insertions, 0 deletions
diff --git a/examples/mobile/quickhit/plugins/LevelOne/Level.qml b/examples/mobile/quickhit/plugins/LevelOne/Level.qml
new file mode 100644
index 00000000..03cc1c15
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/Level.qml
@@ -0,0 +1,215 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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/examples/mobile/quickhit/plugins/LevelOne/debian/changelog b/examples/mobile/quickhit/plugins/LevelOne/debian/changelog
new file mode 100644
index 00000000..de7ac989
--- /dev/null
+++ b/examples/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/examples/mobile/quickhit/plugins/LevelOne/debian/compat b/examples/mobile/quickhit/plugins/LevelOne/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/mobile/quickhit/plugins/LevelOne/debian/control b/examples/mobile/quickhit/plugins/LevelOne/debian/control
new file mode 100644
index 00000000..c46afefb
--- /dev/null
+++ b/examples/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/examples/mobile/quickhit/plugins/LevelOne/debian/copyright b/examples/mobile/quickhit/plugins/LevelOne/debian/copyright
new file mode 100644
index 00000000..fb9e5a8e
--- /dev/null
+++ b/examples/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/examples/mobile/quickhit/plugins/LevelOne/debian/dirs b/examples/mobile/quickhit/plugins/LevelOne/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/examples/mobile/quickhit/plugins/LevelOne/debian/postinst b/examples/mobile/quickhit/plugins/LevelOne/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/examples/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/examples/mobile/quickhit/plugins/LevelOne/debian/rules b/examples/mobile/quickhit/plugins/LevelOne/debian/rules
new file mode 100644
index 00000000..53a1d2ea
--- /dev/null
+++ b/examples/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/examples/mobile/quickhit/plugins/LevelOne/gfx/background3.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/background3.png
new file mode 100644
index 00000000..c81875ac
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/background3.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
new file mode 100644
index 00000000..94f149bd
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
new file mode 100644
index 00000000..448f8ca6
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
new file mode 100644
index 00000000..c0b28d86
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/fire.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/fire.png
new file mode 100644
index 00000000..84010340
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/fire.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/fire2.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
new file mode 100644
index 00000000..139aa611
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/missile2.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
new file mode 100644
index 00000000..dacd6106
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
new file mode 100644
index 00000000..464d603d
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/ship.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/ship.png
new file mode 100644
index 00000000..cb7851c4
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/ship.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/star3.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/star3.png
new file mode 100644
index 00000000..f37a3917
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/star3.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/gfx/transparent.png b/examples/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
new file mode 100644
index 00000000..3aa1e413
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/levelone.cpp b/examples/mobile/quickhit/plugins/LevelOne/levelone.cpp
new file mode 100644
index 00000000..65fd5595
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/levelone.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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;
+}
diff --git a/examples/mobile/quickhit/plugins/LevelOne/levelone.h b/examples/mobile/quickhit/plugins/LevelOne/levelone.h
new file mode 100644
index 00000000..54067182
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/levelone.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LEVELONE_H
+#define LEVELONE_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+#include "levelplugininterface.h"
+
+class LevelOne : public LevelPluginInterface
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0" FILE "levelone.json")
+
+ // 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/examples/mobile/quickhit/plugins/LevelOne/levelone.json b/examples/mobile/quickhit/plugins/LevelOne/levelone.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/levelone.json
@@ -0,0 +1 @@
+{}
diff --git a/examples/mobile/quickhit/plugins/LevelOne/levelone.pro b/examples/mobile/quickhit/plugins/LevelOne/levelone.pro
new file mode 100644
index 00000000..23bd275a
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/levelone.pro
@@ -0,0 +1,97 @@
+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/examples/mobile/quickhit/plugins/LevelOne/sound/crash.wav b/examples/mobile/quickhit/plugins/LevelOne/sound/crash.wav
new file mode 100644
index 00000000..8076f0f6
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/sound/crash.wav
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav b/examples/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
new file mode 100644
index 00000000..e9e3ac03
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/sound/rocket.wav b/examples/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
new file mode 100644
index 00000000..8c0dee9a
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
Binary files differ
diff --git a/examples/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav b/examples/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
new file mode 100644
index 00000000..d2b451cc
--- /dev/null
+++ b/examples/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
Binary files differ