STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228117
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/97964031?noj=FRM97964031-11DC" width="1" height="1"></div>

The-PlatformGame Tutorial.swf

This is the info page for
Flash #62419

(Click the ID number above for more basic data on this flash file.)


Text
LOADING

%

click here to join

PLAY

go inside the
background
and convert the ground
to a symbol and give it
the instance name

"platform"

<p align="left"><font face="Arial_24pt_st" size="24" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">this._y = this._y + 10;</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p>

so give it this AS

<p align="left"><font face="Arial_24pt_st" size="24" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">while(this.hitTest(_root.bg.platform)){</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">this._y = this._y - 10;</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p>

<p align="left"><font face="Arial_24pt_st" size="24" color="#000000">onClipEvent (enterFrame) {</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">if (Key.isDown(Key.RIGHT)) {</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">_root.bg._x = _root.bg._x+10;</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">else if (Key.isDown(Key.LEFT)) {</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">_root.bg._x = _root.bg._x+-10;</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p>

ok now if you want a wall you must put
the wall inside the background
so it will move along with it

while were at it lets just
call the walls instace
name "wall"

AS for the Wall

put this AS in the Ball

<p align="left"><font face="Arial_24pt_st" size="24" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">if(this.hitTest(_root.bg.wall))</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">_root.bg._x = _root.bg._x - 10;</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p><p align="left"><font face="Arial_24pt_st" size="24" color="#000000">}</font></p>

oooooooooh k  i think heres gonna be our check
point our Action Script Should look like this.

<p align="left"><font face="Arial_10pt_st" size="10" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">this._y = this._y + 10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">while(this.hitTest(_root.bg.platform)){</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">this._y = this._y - 10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">onClipEvent (enterFrame) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">if (Key.isDown(Key.RIGHT)) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x+10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">else if (Key.isDown(Key.LEFT)) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x+-10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">if(this.hitTest(_root.bg.wall))</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x - 10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"></p>

but we can put all of the AS groups together
groups are such as
onClipEvent(enterFrame|| or|| load|| etc..){

so our action script could
look like this

<p align="left"><font face="Arial_10pt_st" size="10" color="#000000">onClipEvent (enterFrame) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">this._y = this._y+10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">while <sbr />(this.hitTest(_root.bg.platform)) <sbr />{</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">this._y = this._y-10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">if (Key.isDown(Key.RIGHT)) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x+10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">} else if <sbr />(Key.isDown(Key.LEFT)) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x+-10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">if (this.hitTest(_root.bg.wall)) {</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">_root.bg._x = _root.bg._x-10;</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"><font face="Arial_10pt_st" size="10" color="#000000">}</font></p><p align="left"></p><p align="left"></p>

cool right?

ok but i suggest keeping the jump action script
seperate heres the jump code with SPACE

<p align="left"><font face="Arial_8pt_st" size="8" color="#000000">onClipEvent (enterFrame) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (Key.isDown(Key.SPACE) &amp;&amp; !jumping) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">gotoAndStop(6);</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">vel_y = 35;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">jumping = true;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (jumping == true) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">gotoAndStop(7);</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">vel_y -= 2;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (vel_y&lt;=-_root.gravity) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">vel_y = -_root.gravity;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this._y -= vel_y;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (_root.bg.platform.hitTest(this._x, this._y+35, true)) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">vel_y = 0;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">jumping = false;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this._y += gravity;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (_root.bg.platform.hitTest(this._x, this._y+1, true)) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this._y -= gravity;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"></p>

<p align="left"><font face="Arial_37pt_st" size="37" color="#000000">gravity = 10;</font></p>

ok now we want it so it goes to the frame wen you
push right and it goes to frame 2 and if you push left
it turns around but its still on Frame 2

its done with _xscale

so itd be

<p align="left"><font face="Arial_8pt_st" size="8" color="#000000">onClipEvent(enterFrame){</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">if (Key.isDown(Key.LEFT)) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this._xscale = -100;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">gotoAndPlay(2);</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">} else if (Key.isDown(Key.RIGHT)) {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this.gotoAndStop(2);</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this._xscale = +100;</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">} else {</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">this.gotoAndStop(1);</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p><p align="left"><font face="Arial_8pt_st" size="8" color="#000000">}</font></p>

one more scene
just to prove all this
works

k?

END!

ActionScript [AS1/AS2]

Frame 2
loadedbytes = getBytesLoaded(); totalbytes = getBytesTotal(); if (loadedbytes == totalbytes) { gotoAndPlay (4); } frame = int(loadedbytes / (totalbytes / 100));
Frame 3
gotoAndPlay (2);
Frame 4
stop();
Frame 5
stop();
Instance of Symbol 46 MovieClip in Frame 5
onClipEvent (enterFrame) { this._y = this._y + _root.gravity; while (this.hitTest(_root.bg.platform)) { this._y = ((this._y + (-_root.gravity)) + 0) - 0; } if (Key.isDown(37)) { _root.bg._x = _root.bg._x + _root.speed; this._xscale = -100; gotoAndPlay (6); } else if (Key.isDown(39)) { _root.bg._x = _root.bg._x + (-_root.speed); this.gotoAndStop(2); this._xscale = 100; } else if (Key.isDown(40)) { this.gotoAndStop(4); } else if (Key.isDown(38)) { this.gotoAndStop(8); } else { this.gotoAndStop(1); } } onClipEvent (enterFrame) { if (Key.isDown(32) && (!jumping)) { gotoAndStop (10); vel_y = 35; jumping = true; } if (jumping == true) { gotoAndStop (11); vel_y = vel_y - 2; if (vel_y <= (-_root.gravity)) { vel_y = -_root.gravity; } this._y = this._y - vel_y; } if (_root.bg.platform.hitTest(this._x, this._y + 35, true)) { vel_y = 0; jumping = false; this._y = this._y + gravity; if (_root.bg.platform.hitTest(this._x, this._y + 1, true)) { this._y = this._y - gravity; } } }
Frame 6
stop();
Frame 7
stop();
Frame 8
stop();
Frame 9
stop();
Instance of Symbol 46 MovieClip in Frame 9
onClipEvent (enterFrame) { this._y = this._y + 10; }
Frame 10
stop();
Instance of Symbol 46 MovieClip in Frame 10
onClipEvent (enterFrame) { this._y = this._y + 10; } onClipEvent (enterFrame) { if (this.hitTest(_root.bg.platform)) { this._y = this._y - 10; } }
Frame 11
stop();
Instance of Symbol 75 MovieClip in Frame 11
onClipEvent (enterFrame) { if (Key.isDown(39)) { _root.bg._x = _root.bg._x + 10; } else if (Key.isDown(37)) { _root.bg._x = _root.bg._x + -10; } }
Frame 12
stop();
Instance of Symbol 75 MovieClip in Frame 12
onClipEvent (enterFrame) { this._y = this._y + 10; while (this.hitTest(_root.bg.platform)) { this._y = this._y - 10; } if (Key.isDown(39)) { _root.bg._x = _root.bg._x + 10; } else if (Key.isDown(37)) { _root.bg._x = _root.bg._x + -10; } }
Frame 13
stop();
Frame 14
stop();
Frame 15
stop();
Frame 16
stop();
Frame 17
stop();
Instance of Symbol 46 MovieClip in Frame 17
onClipEvent (enterFrame) { if (Key.isDown(32) && (!jumping)) { gotoAndStop (10); vel_y = 35; jumping = true; } if (jumping == true) { gotoAndStop (11); vel_y = vel_y - 2; if (vel_y <= (-_root.gravity)) { vel_y = -_root.gravity; } this._y = this._y - vel_y; } if (_root.bg.platform.hitTest(this._x, this._y + 35, true)) { vel_y = 0; jumping = false; this._y = this._y + 10; if (_root.bg.platform.hitTest(this._x, this._y + 1, true)) { this._y = this._y - 10; } } }
Frame 18
stop();
Frame 19
stop();
Instance of Symbol 109 MovieClip in Frame 19
onClipEvent (enterFrame) { if (Key.isDown(37)) { this._xscale = -100; gotoAndPlay (6); } else if (Key.isDown(39)) { this.gotoAndStop(2); this._xscale = 100; } else { this.gotoAndStop(1); } }
Frame 20
stop();
Frame 21
stop(); gravity = 10; speed = 10;
Instance of Symbol 46 MovieClip in Frame 21
onClipEvent (enterFrame) { this._y = this._y + _root.gravity; while (this.hitTest(_root.bg.platform)) { this._y = ((this._y + (-_root.gravity)) + 0) - 0; } if (Key.isDown(37)) { _root.bg._x = _root.bg._x + _root.speed; this._xscale = -100; gotoAndPlay (6); } else if (Key.isDown(39)) { _root.bg._x = _root.bg._x + (-_root.speed); this.gotoAndStop(2); this._xscale = 100; } else if (Key.isDown(40)) { this.gotoAndStop(4); } else if (Key.isDown(38)) { this.gotoAndStop(8); } else { this.gotoAndStop(1); } } onClipEvent (enterFrame) { if (Key.isDown(32) && (!jumping)) { gotoAndStop (10); vel_y = 35; jumping = true; } if (jumping == true) { gotoAndStop (11); vel_y = vel_y - 2; if (vel_y <= (-_root.gravity)) { vel_y = -_root.gravity; } this._y = this._y - vel_y; } if (_root.bg.platform.hitTest(this._x, this._y + 35, true)) { vel_y = 0; jumping = false; this._y = this._y + gravity; if (_root.bg.platform.hitTest(this._x, this._y + 1, true)) { this._y = this._y - gravity; } } }
Symbol 30 Button
on (release) { getURL ("http://s7.invisionfree.com/Sprite_Crew_Forums/index.php?"); }
Symbol 41 MovieClip Frame 4
stop();
Symbol 42 Button
on (release) { play(); }
Symbol 46 MovieClip Frame 1
stop();
Symbol 53 Button
on (release) { nextFrame(); }
Symbol 56 Button
on (release) { prevFrame(); }

Library Items

Symbol 1 GraphicUsed by:Timeline
Symbol 2 FontUsed by:3 6 7 9 32 33 35
Symbol 3 TextUses:2Used by:5
Symbol 4 GraphicUsed by:5 41 42
Symbol 5 MovieClipUses:3 4Used by:Timeline
Symbol 6 EditableTextUses:2Used by:Timeline
Symbol 7 TextUses:2Used by:Timeline
Symbol 8 GraphicUsed by:Timeline
Symbol 9 TextUses:2Used by:Timeline
Symbol 10 GraphicUsed by:29 30
Symbol 11 GraphicUsed by:29
Symbol 12 GraphicUsed by:29
Symbol 13 GraphicUsed by:29
Symbol 14 GraphicUsed by:29
Symbol 15 GraphicUsed by:29
Symbol 16 GraphicUsed by:29
Symbol 17 GraphicUsed by:29
Symbol 18 GraphicUsed by:29
Symbol 19 GraphicUsed by:29
Symbol 20 GraphicUsed by:29
Symbol 21 GraphicUsed by:29
Symbol 22 GraphicUsed by:29
Symbol 23 GraphicUsed by:29
Symbol 24 GraphicUsed by:29
Symbol 25 GraphicUsed by:29
Symbol 26 GraphicUsed by:29
Symbol 27 GraphicUsed by:29
Symbol 28 GraphicUsed by:29
Symbol 29 MovieClipUses:10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28Used by:30
Symbol 30 ButtonUses:29 10Used by:Timeline
Symbol 31 SoundUsed by:Timeline
Symbol 32 EditableTextUses:2Used by:Timeline
Symbol 33 EditableTextUses:2Used by:Timeline
Symbol 34 GraphicUsed by:42
Symbol 35 TextUses:2Used by:37 41 42
Symbol 36 GraphicUsed by:37
Symbol 37 MovieClipUses:35 36Used by:42
Symbol 38 GraphicUsed by:41
Symbol 39 GraphicUsed by:41
Symbol 40 GraphicUsed by:41
Symbol 41 MovieClipUses:35 4 38 39 40Used by:42
Symbol 42 ButtonUses:34 37 41 35 4Used by:Timeline
Symbol 43 GraphicUsed by:Timeline
Symbol 44 GraphicUsed by:46 106
Symbol 45 GraphicUsed by:46
Symbol 46 MovieClipUses:44 45Used by:Timeline
Symbol 47 GraphicUsed by:48
Symbol 48 MovieClipUses:47Used by:49
Symbol 49 MovieClipUses:48Used by:Timeline
Symbol 50 GraphicUsed by:53
Symbol 51 GraphicUsed by:53
Symbol 52 GraphicUsed by:53 56
Symbol 53 ButtonUses:50 51 52Used by:Timeline
Symbol 54 GraphicUsed by:56
Symbol 55 GraphicUsed by:56
Symbol 56 ButtonUses:54 55 52Used by:Timeline
Symbol 57 GraphicUsed by:Timeline
Symbol 58 GraphicUsed by:Timeline
Symbol 59 GraphicUsed by:Timeline
Symbol 60 FontUsed by:61 62
Symbol 61 TextUses:60Used by:Timeline
Symbol 62 TextUses:60Used by:Timeline
Symbol 63 GraphicUsed by:Timeline
Symbol 64 FontUsed by:65 67 68 73 78 79 84 85 86 87
Symbol 65 EditableTextUses:64Used by:Timeline
Symbol 66 GraphicUsed by:Timeline
Symbol 67 TextUses:64Used by:Timeline
Symbol 68 EditableTextUses:64Used by:Timeline
Symbol 69 GraphicUsed by:70 76 82
Symbol 70 MovieClipUses:69Used by:71
Symbol 71 MovieClipUses:70Used by:Timeline
Symbol 72 GraphicUsed by:Timeline
Symbol 73 EditableTextUses:64Used by:Timeline
Symbol 74 GraphicUsed by:75
Symbol 75 MovieClipUses:74Used by:Timeline
Symbol 76 MovieClipUses:69Used by:77
Symbol 77 MovieClipUses:76Used by:Timeline
Symbol 78 TextUses:64Used by:Timeline
Symbol 79 TextUses:64Used by:Timeline
Symbol 80 GraphicUsed by:81
Symbol 81 MovieClipUses:80Used by:83
Symbol 82 MovieClipUses:69Used by:83
Symbol 83 MovieClipUses:81 82Used by:Timeline
Symbol 84 TextUses:64Used by:Timeline
Symbol 85 TextUses:64Used by:Timeline
Symbol 86 EditableTextUses:64Used by:Timeline
Symbol 87 TextUses:64Used by:Timeline
Symbol 88 FontUsed by:89 93
Symbol 89 EditableTextUses:88Used by:Timeline
Symbol 90 FontUsed by:91 92
Symbol 91 TextUses:90Used by:Timeline
Symbol 92 TextUses:90Used by:Timeline
Symbol 93 EditableTextUses:88Used by:Timeline
Symbol 94 FontUsed by:95 96
Symbol 95 TextUses:94Used by:Timeline
Symbol 96 TextUses:94Used by:Timeline
Symbol 97 FontUsed by:98 110
Symbol 98 EditableTextUses:97Used by:Timeline
Symbol 99 GraphicUsed by:Timeline
Symbol 100 FontUsed by:101
Symbol 101 EditableTextUses:100Used by:Timeline
Symbol 102 FontUsed by:103 104 105
Symbol 103 TextUses:102Used by:Timeline
Symbol 104 TextUses:102Used by:Timeline
Symbol 105 TextUses:102Used by:Timeline
Symbol 106 ButtonUses:44Used by:107
Symbol 107 ButtonUses:106Used by:109
Symbol 108 GraphicUsed by:109
Symbol 109 MovieClipUses:107 108Used by:Timeline
Symbol 110 EditableTextUses:97Used by:Timeline
Symbol 111 FontUsed by:112 113 115
Symbol 112 TextUses:111Used by:Timeline
Symbol 113 TextUses:111Used by:Timeline
Symbol 114 GraphicUsed by:Timeline
Symbol 115 TextUses:111Used by:Timeline

Instance Names

"bg"Frame 5Symbol 49 MovieClip
"bg"Frame 10Symbol 71 MovieClip
"bg"Frame 11Symbol 77 MovieClip
"bg"Frame 12Symbol 83 MovieClip
"bg"Frame 21Symbol 49 MovieClip
"platform"Symbol 49 MovieClip Frame 1Symbol 48 MovieClip
"platform"Symbol 71 MovieClip Frame 1Symbol 70 MovieClip
"wall"Symbol 77 MovieClip Frame 1Symbol 76 MovieClip
"wall"Symbol 83 MovieClip Frame 1Symbol 81 MovieClip
"platform"Symbol 83 MovieClip Frame 1Symbol 82 MovieClip




http://swfchan.com/13/62419/info.shtml
Created: 14/4 -2019 07:00:40 Last modified: 14/4 -2019 07:00:40 Server time: 11/05 -2024 05:04:23