Skip to content

Commit f446d5c

Browse files
committed
Pinata Game physics, Added Text Highlighter.
Pinata Game module added. This module adds a swinging to the game. Next step is to combine modules of the game. Text Highlighter also added. This is only in the beginning of the life of the module. This will possibly be trashed in a later version.
1 parent 335c1c8 commit f446d5c

17 files changed

+79
-8
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ local.properties
1515
.classpath
1616
.settings/
1717
.loadpath
18+
/Documentation-Presentation
19+
1820

1921
# External tool builders
2022
.externalToolBuilders/
@@ -126,6 +128,15 @@ Thumbs.db
126128
# Folder config file
127129
Desktop.ini
128130

131+
#############
132+
##ActionScript 3.0
133+
#############
134+
135+
*.xml
136+
*.swf
137+
*.apk
138+
139+
129140

130141
#############
131142
## Python

Book-app.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<versionLabel/>
66
<filename>Book</filename>
77
<description/>
8-
<!-- To localize the description, use the following format for the description element.<description><text xml:lang="en">English App description goes here</text><text xml:lang="fr">French App description goes here</text><text xml:lang="ja">Japanese App description goes here</text></description>-->
8+
<!-- To localize the description, use the following format for the description element.<description><text xml:lang="en">English App description goes here</text><text xml:lang="fr">French App description goes here</text><text xml:lang="ja">Japanese App description goes here</text></description>-->
99
<name>Book</name>
10-
<!-- To localize the name, use the following format for the name element.<name><text xml:lang="en">English App name goes here</text><text xml:lang="fr">French App name goes here</text><text xml:lang="ja">Japanese App name goes here</text></name>-->
10+
<!-- To localize the name, use the following format for the name element.<name><text xml:lang="en">English App name goes here</text><text xml:lang="fr">French App name goes here</text><text xml:lang="ja">Japanese App name goes here</text></name>-->
1111
<copyright/>
1212
<initialWindow>
1313
<content>Book.swf</content>

Book.swf

352 KB
Binary file not shown.

Jogger/JoggerGame.fla

329 KB
Binary file not shown.

Jogger/textLayout_2.0.0.232.swz

182 KB
Binary file not shown.

PageCurl.as

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import flash.events.Event;
66
import net.hires.debug.Stats;
77
import flash.events.TouchEvent;
8+
import flash.events.TimerEvent;
9+
import flash.utils.Timer;
810
//Multitouch.inputMode = MultitouchInputMode.NONE;
911

1012
/**
@@ -13,11 +15,24 @@
1315
*/
1416
public class PageCurl extends Sprite
1517
{
18+
protected var dist:Number;
19+
protected var ang:Number;
20+
protected var dy:Number;
21+
protected var dx:Number;
22+
protected var t:Timer;
23+
24+
1625
[Embed(source = '/rexam-1.jpg')]
1726
protected var Page1:Class;
1827

1928
protected var _image1:Bitmap;
2029

30+
31+
[Embed(source = '/Firefox.jpg')]
32+
protected var Page2:Class;
33+
34+
protected var _image2:Bitmap;
35+
2136
protected var _filter:PageCurlFilter;
2237

2338
public function PageCurl():void
@@ -29,6 +44,11 @@
2944
_image1.y = stage.stageHeight * 0.5 - _image1.height * 0.5;
3045
_image1.filters = [_filter]
3146

47+
_image2 = new Page2();
48+
_image2.x = stage.stageWidth * 0.5 - _image2.width * 0.5;
49+
_image2.y = stage.stageHeight * 0.5 - _image2.height * 0.5;
50+
_image2.filters = [_filter]
51+
3252
addEventListener(Event.ENTER_FRAME, onFrame);
3353
addEventListener(TouchEvent.TOUCH_BEGIN, onTouch);
3454

@@ -39,21 +59,51 @@
3959

4060
public function onFrame(e:Event):void
4161
{
42-
var dx:Number = 1 - mouseX / stage.stageWidth;
43-
var dy:Number = 1 - mouseY / stage.stageHeight;
62+
var t:Timer = new Timer(1000, 1);
63+
64+
dx = 1 - mouseX / stage.stageWidth;
65+
dy = 1 - mouseY / stage.stageHeight;
4466

45-
var dist:Number = Math.sqrt(dx * dx + dy * dy);
46-
var ang:Number = Math.atan2(dy, dx);
67+
dist = Math.sqrt(dx * dx + dy * dy);
68+
ang = Math.atan2(dy, dx);
4769

4870
_filter.setPageCurl(10 - dist*5, ang);
4971
_image1.filters = [_filter];
72+
_image2.filters = [_filter];
5073

74+
t.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
75+
76+
t.start();
5177
}
5278

79+
5380
public function onTouch(e:TouchEvent):void
5481
{
82+
//code goes here for touch screen devices
83+
84+
}
85+
86+
public function OMGTimer() {
87+
t = new Timer(10000, 1);
88+
t.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
89+
trace("Timer running");
90+
t.start();
91+
}
92+
93+
private function onTimerComplete(event : TimerEvent) : void
94+
{
95+
if (dist <= 1.4 && ang <= 1.4 && stage.contains(_image1))
96+
{
97+
trace("its time");
98+
removeChild(_image1);
99+
addChild(_image2 );
100+
addChild(new Stats);
101+
102+
103+
}
55104

56105
}
106+
57107

58108
}
59109

Pinata/Candy catcher.fla

330 KB
Binary file not shown.

Pinata/GameOver.JPG

89.1 KB
Loading

Pinata/GameOver.psd

2.81 MB
Binary file not shown.

Pinata/pinatajpg.jpg

23.4 KB
Loading

0 commit comments

Comments
 (0)