-
Notifications
You must be signed in to change notification settings - Fork 0
/
GamePlacard.as
99 lines (95 loc) · 2.9 KB
/
GamePlacard.as
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
package {
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.display.Sprite;
/**
* Shitty Fucking Art Game
* @author Sean Finch
* @version 27APR2011
*/
/* Copyright © 2011 - 2015 Sean Finch
This file is part of Shitty Fucking Art Game.
bang is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
bang is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with bang. If not, see <http://www.gnu.org/licenses>. */
public class GamePlacard {
private var _bgL:DisplayObjectContainer;
private var _plL:DisplayObjectContainer;
public var backing:MovieClip;
private var state:int;
private var pressZ:Sprite;
private var timer:int;
public function GamePlacard(bg:DisplayObjectContainer, ex:DisplayObjectContainer, mode:int) {
_bgL = bg;
_plL = ex;
state = mode;
timer = 60;
switch(state) {
case 4:
backing = new howplay();
break;
case 3:
backing = new opening();
break;
case 2:
backing = new diary();
var B:int = SelectionMemory.diaryEntries[Math.ceil(SelectionMemory.diaryEntries.length * Math.random())];
var XI:int = SelectionMemory.diaryEntries.indexOf(B);
SelectionMemory.diaryEntries.splice(XI, 1);
backing.gotoAndStop(B);
break;
default:
backing = new titleCard();
backing.gotoAndStop(SelectionMemory.day);
if (!SelectionMemory.soundOff) {
SelectionMemory.sHandler.dunDun.play();
}
if (SelectionMemory.day != 5) {
var BB:int = SelectionMemory.dayPlacardSlogans[Math.ceil(SelectionMemory.dayPlacardSlogans.length * Math.random())];
var XII:int = SelectionMemory.dayPlacardSlogans.indexOf(BB);
SelectionMemory.dayPlacardSlogans.splice(XII, 1);
backing.subtitle.gotoAndStop(BB);
}
break;
}
backing.x = 240 - 0.5;
backing.y = 120;
_bgL.addChild(backing);
pressZ = new zbutton();
pressZ.x = 480 + pressZ.width / 2;
pressZ.y = 240 - pressZ.height / 2;
_plL.addChild(pressZ);
}
public function BLASTSHEEP():void {
backing.gotoAndPlay(328);
}
public function getState():int {
return state;
}
public function getTimer():int {
return timer;
}
public function cleanUp():void {
_bgL.removeChild(backing);
_plL.removeChild(pressZ);
backing = null;
pressZ = null;
}
public function update():void {
if (state != 3) {
if (timer > 0) {
timer--;
} else if (pressZ.x > (480 - pressZ.width / 2)) {
pressZ.x -= 4;
}
}
}
}
}