Skip to content

Commit 304e225

Browse files
committed
Custom sizes for flash games.
1 parent e353cd6 commit 304e225

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

competitions/osgcc_6.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ games:
66
languages: [ActionScript, HaXe]
77
slug: monastery
88
flash: monastery
9+
width: 800px
10+
height: 600px
911
summary: "In this game you are the chef of the Monastery, a huge spaceship where food is running scarce!
1012
But, when everything seemed lost, the Monastery landed on a wonderful planet full of vegetables! Bad thing is... The plants on this planet walk and are invading your space kitchen!!
1113
Can you restore the botanic order by bringing the invaders to the cooking hearth and keeping your comrades from starvation? WASD to move."
@@ -20,6 +22,8 @@ games:
2022
languages: [ActionScript, HaXe]
2123
flash: spectrum
2224
slug: spectrum
25+
width: 640px
26+
height: 480px
2327
source: http://github.com/osgcc/osgcc6-Spectrum
2428
about: http://github.com/osgcc/osgcc6-Spectrum/blob/master/README
2529

css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ nav {
2020
box-shadow: 0 0 10px #111;
2121
}
2222

23+
section.game h1 {
24+
margin-bottom: 60px;
25+
}
26+
2327
section.text {
2428
margin-bottom: 40px;
2529
}

games/osgcc_6-monastery.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
</nav>
2626
<input id='game-name' type='hidden' value='Monastery'>
2727
<input id='game-slug' type='hidden' value='monastery'>
28+
<input id='game-width' type='hidden' value='800px'>
29+
<input id='game-height' type='hidden' value='600px'>
2830
<script src='/js/swfobject.js' type='text/javascript'></script>
2931
<script src='/js/flash.js' type='text/javascript'></script>
3032
<section class='game'>

games/osgcc_6-spectrum.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
</nav>
2626
<input id='game-name' type='hidden' value='Spectrum'>
2727
<input id='game-slug' type='hidden' value='spectrum'>
28+
<input id='game-width' type='hidden' value='640px'>
29+
<input id='game-height' type='hidden' value='480px'>
2830
<script src='/js/swfobject.js' type='text/javascript'></script>
2931
<script src='/js/flash.js' type='text/javascript'></script>
3032
<section class='game'>

js/flash.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ var params = {
1111
var attributes = {
1212
id:"Monastery"
1313
};
14-
var game_name = document.getElementById('game-name').value;
15-
var game_slug = document.getElementById('game-slug').value;
14+
var game_name = document.getElementById('game-name').value;
15+
var game_slug = document.getElementById('game-slug').value;
16+
var game_width = document.getElementById('game-width').value;
17+
var game_height = document.getElementById('game-height').value;
1618
swfobject.embedSWF(
1719
"/games/" + game_slug + ".swf",
18-
"alt-content", "800px", "600px", "10.0.0",
20+
"alt-content", game_width, game_height, "10.0.0",
1921
"/flash/expressInstall.swf",
2022
flashvars, params, attributes);

layout/game.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
%input#game-name{:type => "hidden", :value => game["name"]}
22
%input#game-slug{:type => "hidden", :value => game["slug"]}
3+
%input#game-width{:type => "hidden", :value => game["width"]}
4+
%input#game-height{:type => "hidden", :value => game["height"]}
35
%script{:type => "text/javascript", :src => "/js/swfobject.js"}
46
%script{:type => "text/javascript", :src => "/js/flash.js"}
57
%section.game

0 commit comments

Comments
 (0)