This post has been edited 2 times, last edit by "ciul" (Apr 18th 2011, 4:59pm)
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer


: https://pame.virtualtuur.comThis post has been edited 2 times, last edit by "ciul" (May 12th 2011, 6:57pm)
Sorry Aleskey.sorry can't see the link. Here is my attempt to make a game http://www.youtube.com/watch?v=Wcky5jNOrhE
Hi ErikPano,I really like this.
Could you please share how you can keep a score ? Is it a hotspot that triggers some javascript or a custom made flash ?
I see a "score" plugin in your xml file, but how does it work ?
Ideally I want to try and make a "find hidden objects" game, but have no idea where to start (if it's even possible at all), but I am impressed with your game. It shows much promise.
Best,
Erki
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
<krpano version="1.0.8" onstart="action(startup);" logkey="true" showerrors="true" >
<action name="startup">
qtvrcursor();
view_fisheye();
</action>
<preview type="grid(CUBE,18,18,500,0x000000,0x000000,0x000000);" />
<image type="CUBE">
<left url="data/space.jpg" />
<front url="data/space.jpg" />
<right url="data/space.jpg" />
<back url="data/space.jpg" />
<up url="data/sun.jpg" />
<down url="data/pano_d.jpg" />
</image>
<progress showload="none" showwait="none" />
<include url="skin/defaultskin.xml" />
<plugin name="soundinterface"
url="%SWFPATH%/plugins/soundinterface.swf"
preload="true"
rootpath="%SWFPATH%/sounds/"
volume="1"
onloaded="preloadsound(game.mp3);preload(explosion.mp3);"
/>
<hotspot name="logo"
url="%SWFPATH%/graphics/logo+text.png"
ath="0" atv="0"
scale="1"
onloaded=""
onhover="showtext(Start New Game);"
onclick="loadscene(gamestart);"
onover="tween(scale,1.2,0.5,easeOutElastic);"
onout="tween(scale,1,0.5,easeOutElastic);"
/>
<plugin name="instructions"
url="%SWFPATH%/plugins/textfield.swf"
align="lefttop"
x="10" y="0"
html="data:instructionsdata"
css="data:cssdata"
autosize="true"
background="false"
/>
<data name="instructionsdata">
<h3>Instructions:</h3>
<p>
The Sun threatens to destroy the Earth,
scientists has entrusted you the super laser machine,
You are the only one who can save the world!
Destroy Fire Balls before time limit.
</p>
<p>
<font size="-6">
<font color="#FF00000">Note:<br/></font>
- You shall use a mouse to play more comfortable. <br/>
- Click on Fire Balls to destroy them before they reach the Earth. <br/>
- First Fire Ball is just for illustration.
</font>
</p>
</data>
<data name="cssdata">
h3{color:#FF0000;font-size:40;}
p{color:#FFFFFF;font-size:26;}
</data>
<!----------------------------------------------------- SCENES ----------------------------------------------------->
<!------------------------------------------------------------------------------------------------------------------>
<scene name="gamestart" onstart="startgame();">
<progress showload="none" />
<image type="CUBE">
<left url="data/space.jpg" />
<front url="data/space.jpg" />
<right url="data/space.jpg" />
<back url="data/space.jpg" />
<up url="data/sun.jpg" />
<down url="data/pano_d.jpg" />
</image>
<plugin name="score" keep="true"
url="%SWFPATH%/plugins/textfield.swf"
html="[p]Score: [/p]"
css="p{font-size:40;color:#FF0000;}"
align="rightbottom" edge="rightbottom"
autosize="true" width="20%"
background="false"
selectable="false"
x="0" y="10"
/>
</scene>
<scene name="gameover_goodending" onstart="startup();">
<action name="startup">
stopallsounds();
showtext(GAME OVER[br/]YOU SAVED THE EARTH, game_over_good);
playsound2D(auto, win.mp3, 0.8);
</action>
<preview type="grid(CUBE,18,18,500,0x000000,0x000000,0x000000);" />
<image type="CUBE">
<left url="data/space.jpg" />
<front url="data/space.jpg" />
<right url="data/space.jpg" />
<back url="data/space.jpg" />
<up url="data/sun.jpg" />
<down url="data/pano_d.jpg" />
</image>
</scene>
<scene name="gameover_badending" onstart="startup();">
<action name="startup">
stopallsounds();
showtext(GAME OVER[br/]EARTH WAS DESTROYED[br/], game_over);
txtadd(gameover_message, 'You need minumum score of ', get(score_towin), ' to win.');
delayedcall(5, showtext(get(gameover_message), game_over); );
playsound2D(auto, lose.mp3, 0.8);
</action>
<preview type="grid(CUBE,18,18,500,0x000000,0x000000,0x000000);" />
<image type="CUBE">
<left url="data/space.jpg" />
<front url="data/space.jpg" />
<right url="data/space.jpg" />
<back url="data/space.jpg" />
<up url="data/sun.jpg" />
<down url="data/earthdestroyed.jpg" />
</image>
</scene>
<!----------------------------------------------------- /SCENES ----------------------------------------------------->
<!------------------------------------------------------------------------------------------------------------------->
<action name="startgame">
<!-- Developing code? -->
set(develop, false);
<!-- GAME ENDING PARAMETERS -->
set(fireballs_limit, 10);
set(score_towin, 6);
set(gameended, false);
showtext('The Sun is throwing fire balls to the Earth', game_cursor_text);
delayedcall(3, showtext('Scientists has entrusted you the super laser machine', game_cursor_text););
delayedcall(6, showtext('You are the only one who can save the Earth!', game_cursor_text); );
<!-- Play Game Sound -->
playsound2D(game, game.mp3,0.5,0,0);
lookto(0,-50);
wait(1);
initialfire();
</action>
<action name="makefire">
if(firenumber === null, set(firenumber,0););
txtadd(firename,'fire_',get(firenumber));
if(firenumber GE fireballs_limit,
set(gameended, true);
);
inc(firenumber);
if(gameended == true,
if(score GE score_towin,
loadscene(gameover_goodending);
,
loadscene(gameover_badending);
);
stopall();
,
delayedcall(1, createfire(firename););
);
</action>
<action name="createfire">
if(develop == true,
showlog();
trace('createfire: ', %1);
);
if(%1 !== null,
mul(firepos, random, 349);
add(firepos, 1);
roundval(firepos);
addhotspot(%1);
set(hotspot[%1].url,'data/fireball.png');
set(hotspot[%1].ath, get(firepos));
set(hotspot[%1].atv,-50);
set(hotspot[%1].onclick, inc(score); if(develop == true,trace('score: ', score);); txtadd(scoretext,'[p]Score: ',get(score),'[/p]');showtext(get(scoretext),game_cursor_text); destroyfire(%1); );
tween(hotspot[%1].atv,42,3,linear, if(develop == true,trace(%1,' being destroyed.');); destroyfire(%1); );
);
</action>
<action name="initialfire">
<!-- Initial Score Value -->
set(score, 0);
addhotspot(firstfire);
set(hotspot[firstfire].url, data/fireball.png);
set(hotspot[firstfire].enabled, false);
set(hotspot[firstfire].ath, 0);
set(hotspot[firstfire].atv, -50);
tween(hotspot[firstfire].atv,42,4,linear, destroyfire(hotspot[firstfire].name); );
</action>
<action name="destroyfire">
if(develop == true,
showlog();
trace('destroyfire: ', %1);
);
if(%1 !== null,
if(%1 == 'firstfire',
lookto(0,45);
set(hotspot[get(%1)].enabled,false);
set(hotspot[get(%1)].url,'data/explosion.gif');
,
set(hotspot[%1].enabled,false);
set(hotspot[%1].url,'data/explosion.gif');
);
playsound2D(explosion,explosion.mp3,1.0,0,1);
if(%1 == 'firstfire',
tween(hotspot[get(%1)].alpha,0,0.5,linear, lookto(0,-90);removehotspot(get(%1)); makefire(); );
,
stoptween(hotspot[%1].atv);
txtadd(scoretext,'[p]Score: ',get(score),' / ',get(fireballs_limit),'[/p]');
tween(hotspot[%1].alpha,0,0.5,linear, removehotspot(%1); makefire(); );
if(develop == true, showlog(); trace(scoretext); );
set(plugin[score].html, get(scoretext));
);
);
</action>
</krpano>
|