STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229672 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2596 · P5191 |
This is the info page for Flash #59889 |
Starting off |
Place a filled rectangle covering the whole stage Make the rectangle into a button named ‘hitarea’ Double-click on your new hitarea button. Create a keyframe under ‘hit’ and remove the content of the frames ‘up’, ‘over’ and ‘down’, leaving the rectangle only on the hit frame. This will be an invisible button which allow the bullet holes to appear and the gunfire sound to play. On the main stage open the properties window the for hitarea button and names its instance name ‘hit1’ |
Next |
HitArea |
Back |
Find or download the gunfire sound you want to play when the mouse is clicked. Import this gunfire sound to the library or stage. If you cannot see the library window on the right hand side, on the top menu go to window- library. Right click on the audio file in the library and select "linkage". Tick the "export for Actionscript" textbox and in the identifier box, write "gunfire". Lock the layer that the hit button is on and create another layer and call it "code". Open the actionscript window for the code layer/frame and write the following code: |
Gunfire Sound |
// gunfire sounds var gunfire = new Sound(); gunfire.attachSound("gunfire"); // When mouse is clicked, start sound _root.hit1.onPress = function() { gunfire.start(); } |
The Gun Sights |
Create another layer and call it "sights". Draw the sights of a gun however you want. Select the drawing and make it into a movie clip named ‘gun’. In the instance box for the gun movie clip also write ‘gun’ |
Go to the "code" layer and input the following code under our previous one. // initialise the movie _root.onLoad = function() { // hide the mouse Mouse.hide(); }; // loop code _root.onEnterFrame = function() { //put cross hairs to mouse coords _root.gun._x = _root._xmouse; _root.gun._y = _root._ymouse; }; Now test your game by pressing control + Enter. The sights should follow the mouse and gunfire sound play when you click. If this does not happen go back and check you have followed the instructions properly. |
The bullet holes |
Create a new layer named ‘bullet’ and draw a small circle. Make it into a movie clip, also named ‘bullet’. In the instance name textbox of the movie clip write ‘bull’. To make the bullet hole fade away go into it's movie clip, make it into a graphic and tween it's alpha from 100 to 0. Write the following code into the actions of the bullet movieclip. onClipEvent(load){ this._x = _root._xmouse; this._y = _root._ymouse; } 1.make sure it says"Actions - Movie Clip" at the top of the Actions window and not "Actions - Frame". |
More Code |
2.Now select The "code" layer, delete the previous code and write: |
var i; // gunfire sounds var gunfire = new Sound(); gunfire.attachSound("gunfire"); _root.hit1.onPress = function() { gunfire.start(); i++; // create bullet holes _root.bull.duplicateMovieClip("bulletNew", i); if (i == 10) { i = 0; } }; // initialise stuff _root.onLoad = function() { // hide the mouse Mouse.hide(); }; //loop root.onEnterFrame = function() { //put cross hairs to mouse coords _root.gun._x = _root._xmouse; _root.gun._y = _root._ymouse; }; |
Making the target |
1.Make a new layer and call it target. 2.On it, draw some sort of target. Mine is simply a square with a face, but yours can be whatever you want. 3.Select your target and make it into a movieclip, In the instance name textbox write ‘target_mc’. |
My Target |
Making the Blood |
1.Go back to the gunsights movieclip and open it. 2.Create a second keyframe inside the movieclip and delete the contents of it. 3.In it’s place draw some kind of blood, or a picture of your target having been shot like mine. 4.Create another layer , 5.On this layer make a keyframe on frame 1 and put the following code in: stop(); |
var i; // gunfire sounds var gunfire = new Sound(); gunfire.attachSound("gunfire"); _root.hit1.onPress = function() { gunfire.start(); i++; // make bullet holes _root.bull.duplicateMovieClip("bulletNew", i); if (i == 10) { i = 0; } |
continues onto next page |
Now we will make the target move across the screen. Once again go back to the code layer on the main stage and delete all the previous actionscript. The following code is very long and will take up 2 slides. Use it to replace the previous one. |
// hit test on target if (_root.target_mc.hitTest(_root._xmouse, _root._ymouse, false)) { // play explosion _root.gun.gotoAndPlay(2); // send target off stage _root.target_mc._x = 0; _root.target_mc._y = random(400); } }; // initialise stuff _root.onLoad = function() { // hide the mouse Mouse.hide(); }; //loop _root.onEnterFrame = function() { //put cross hairs to mouse coords _root.gun._x = _root._xmouse; _root.gun._y = _root._ymouse; // target move _root.target_mc._x += 10; // if it goes offstage, send it stage left if (_root.target_mc._x<0 || _root.target_mc._x>Stage.width) { _root.target_mc._x = 0; _root.target_mc._y = random(400); } }; |
Making a score counter |
Create a new layer and name it ‘score’. On this layer make a textbox big enough for 5 or 6 numbers. Open the properties window and make sure it is Dynamic text, and not input or static. In the ‘var’ box for the textbox write ‘total’. Here are several ways to do the next bit but the way I made it work as to open your sights movie clip and go to the second frame with the blood. Write the following code into the actions for this frame: _root.total = _root.total+100; |
To prevent your score counter from counting wrongly, go to the score layer on the main stage and write the code total = 0; Your simple shooting game should now work properly. You can make yours much better than mine by adding levels, multiple targets better than mine by adding levels, multiple targets, backgrounds and making your targets into movie clips. I hope this has helped you -Jethro |
Press next to see my finished basic shooting game |
Finishing |
0 |
ActionScript [AS1/AS2]
Frame 2stop();Frame 3stop();Frame 4stop();Frame 5stop();Frame 6stop();Frame 7stop();Frame 8stop();Frame 9stop();Frame 10stop();Frame 11stop();Frame 12stop();Frame 13stop();Frame 14stop();Frame 15stop();Frame 16stopAllSounds(); total = 0; Mouse.hide(); stop(); var i; var gunfire = new Sound(); gunfire.attachSound("gunfire"); _root.hit1.onPress = function () { gunfire.start(); i++; _root.bull.duplicateMovieClip("bulletNew", i); if (i == 10) { i = 0; } if (_root.target_mc.hitTest(_root._xmouse, _root._ymouse, false)) { _root.gun.gotoAndPlay(2); _root.target_mc._x = 0; _root.target_mc._y = random(400); } }; _root.onLoad = function () { Mouse.hide(); }; _root.onEnterFrame = function () { _root.gun._x = _root._xmouse; _root.gun._y = _root._ymouse; _root.target_mc._x = _root.target_mc._x + 10; if ((_root.target_mc._x < 0) || (_root.target_mc._x > Stage.width)) { _root.target_mc._x = 0; _root.target_mc._y = random(400); } };Instance of Symbol 133 MovieClip "bull" in Frame 16onClipEvent (load) { this._x = _root._xmouse; this._y = _root._ymouse; }Instance of Symbol 133 MovieClip "bull" in Frame 16onClipEvent (load) { this._x = _root._xmouse; this._y = _root._ymouse; }Instance of Symbol 133 MovieClip "bull" in Frame 16onClipEvent (load) { this._x = _root._xmouse; this._y = _root._ymouse; }Instance of Symbol 133 MovieClip "bull" in Frame 16onClipEvent (load) { this._x = _root._xmouse; this._y = _root._ymouse; }Symbol 8 Buttonon (press) { _root.play(); }Symbol 9 MovieClip Frame 1_root.stop(); PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100; if (PercentLoaded != 100) { setProperty(bar, _xscale , PercentLoaded); } else { gotoAndStop ("loaded"); }Symbol 9 MovieClip Frame 2gotoAndPlay (1);Symbol 16 MovieClip Frame 30stop();Symbol 25 Buttonon (press) { gotoAndPlay (3); }Symbol 32 Buttonon (press) { gotoAndPlay (2); }Symbol 34 Buttonon (press) { gotoAndPlay (4); }Symbol 40 Buttonon (press) { gotoAndPlay (3); }Symbol 42 Buttonon (press) { gotoAndPlay (5); }Symbol 44 Buttonon (press) { gotoAndPlay (4); }Symbol 46 Buttonon (press) { gotoAndPlay (6); }Symbol 52 Buttonon (press) { gotoAndPlay (5); }Symbol 54 Buttonon (press) { gotoAndPlay (7); }Symbol 57 Buttonon (press) { gotoAndPlay (6); }Symbol 59 Buttonon (press) { gotoAndPlay (8); }Symbol 64 Buttonon (press) { gotoAndPlay (7); }Symbol 65 Buttonon (press) { gotoAndPlay (9); }Symbol 72 Buttonon (press) { gotoAndPlay (8); }Symbol 74 Buttonon (press) { gotoAndPlay (10); }Symbol 82 Buttonon (press) { gotoAndPlay (9); }Symbol 84 Buttonon (press) { gotoAndPlay (11); }Symbol 92 Buttonon (press) { gotoAndPlay (12); }Symbol 94 Buttonon (press) { gotoAndPlay (10); }Symbol 99 Buttonon (press) { gotoAndPlay (13); }Symbol 101 Buttonon (press) { gotoAndPlay (11); }Symbol 105 Buttonon (press) { gotoAndPlay (12); }Symbol 107 Buttonon (press) { gotoAndPlay (14); }Symbol 112 Buttonon (press) { gotoAndPlay (15); }Symbol 114 Buttonon (press) { gotoAndPlay (13); }Symbol 120 Buttonon (press) { gotoAndPlay (16); }Symbol 122 Buttonon (press) { gotoAndPlay (14); }Symbol 130 MovieClip Frame 1stop();Symbol 130 MovieClip Frame 2_root.total = _root.total + 100;Symbol 133 MovieClip Frame 40stop();
Library Items
Symbol 1 Sound [gunfire] | Used by:16 | |
Symbol 2 Graphic | Used by:3 | |
Symbol 3 MovieClip | Uses:2 | Used by:9 |
Symbol 4 Graphic | Used by:9 | |
Symbol 5 Graphic | Used by:9 | |
Symbol 6 Graphic | Used by:8 | |
Symbol 7 Graphic | Used by:8 | |
Symbol 8 Button | Uses:6 7 | Used by:9 |
Symbol 9 MovieClip | Uses:3 4 5 8 | Used by:Timeline |
Symbol 10 Graphic | Used by:16 | |
Symbol 11 Graphic | Used by:16 | |
Symbol 12 Graphic | Used by:16 | |
Symbol 13 Graphic | Used by:16 | |
Symbol 14 Graphic | Used by:16 | |
Symbol 15 Graphic | Used by:16 | |
Symbol 16 MovieClip | Uses:10 11 12 1 13 14 15 | Used by:Timeline |
Symbol 17 Graphic | Used by:Timeline | |
Symbol 18 Font | Used by:19 131 | |
Symbol 19 EditableText | Uses:18 | Used by:Timeline |
Symbol 20 Font | Used by:21 22 23 29 30 37 38 47 49 50 55 61 66 68 69 70 76 77 78 87 88 96 97 102 103 109 110 116 117 118 | |
Symbol 21 EditableText | Uses:20 | Used by:Timeline |
Symbol 22 Text | Uses:20 | Used by:Timeline |
Symbol 23 Text | Uses:20 | Used by:25 34 42 46 54 59 65 74 84 92 99 107 112 120 |
Symbol 24 Graphic | Used by:25 | |
Symbol 25 Button | Uses:23 24 | Used by:Timeline |
Symbol 26 Sound | Used by:Timeline | |
Symbol 27 Bitmap | Used by:28 | |
Symbol 28 Graphic | Uses:27 | Used by:Timeline |
Symbol 29 EditableText | Uses:20 | Used by:Timeline |
Symbol 30 Text | Uses:20 | Used by:32 40 44 52 57 64 72 82 94 101 105 114 122 |
Symbol 31 Graphic | Used by:32 | |
Symbol 32 Button | Uses:30 31 | Used by:Timeline |
Symbol 33 Graphic | Used by:34 | |
Symbol 34 Button | Uses:23 33 | Used by:Timeline |
Symbol 35 Graphic | Used by:Timeline | |
Symbol 36 Graphic | Used by:Timeline | |
Symbol 37 Text | Uses:20 | Used by:Timeline |
Symbol 38 Text | Uses:20 | Used by:Timeline |
Symbol 39 Graphic | Used by:40 | |
Symbol 40 Button | Uses:30 39 | Used by:Timeline |
Symbol 41 Graphic | Used by:42 65 | |
Symbol 42 Button | Uses:23 41 | Used by:Timeline |
Symbol 43 Graphic | Used by:44 | |
Symbol 44 Button | Uses:30 43 | Used by:Timeline |
Symbol 45 Graphic | Used by:46 | |
Symbol 46 Button | Uses:23 45 | Used by:Timeline |
Symbol 47 EditableText | Uses:20 | Used by:Timeline |
Symbol 48 Graphic | Used by:Timeline | |
Symbol 49 Text | Uses:20 | Used by:Timeline |
Symbol 50 Text | Uses:20 | Used by:Timeline |
Symbol 51 Graphic | Used by:52 64 | |
Symbol 52 Button | Uses:30 51 | Used by:Timeline |
Symbol 53 Graphic | Used by:54 | |
Symbol 54 Button | Uses:23 53 | Used by:Timeline |
Symbol 55 EditableText | Uses:20 | Used by:Timeline |
Symbol 56 Graphic | Used by:57 | |
Symbol 57 Button | Uses:30 56 | Used by:Timeline |
Symbol 58 Graphic | Used by:59 | |
Symbol 59 Button | Uses:23 58 | Used by:Timeline |
Symbol 60 Graphic | Used by:Timeline | |
Symbol 61 Text | Uses:20 | Used by:Timeline |
Symbol 62 Bitmap | Used by:63 | |
Symbol 63 Graphic | Uses:62 | Used by:Timeline |
Symbol 64 Button | Uses:30 51 | Used by:Timeline |
Symbol 65 Button | Uses:23 41 | Used by:Timeline |
Symbol 66 EditableText | Uses:20 | Used by:Timeline |
Symbol 67 Graphic | Used by:Timeline | |
Symbol 68 Text | Uses:20 | Used by:Timeline |
Symbol 69 Text | Uses:20 | Used by:Timeline |
Symbol 70 EditableText | Uses:20 | Used by:Timeline |
Symbol 71 Graphic | Used by:72 | |
Symbol 72 Button | Uses:30 71 | Used by:Timeline |
Symbol 73 Graphic | Used by:74 | |
Symbol 74 Button | Uses:23 73 | Used by:Timeline |
Symbol 75 Graphic | Used by:Timeline | |
Symbol 76 Text | Uses:20 | Used by:Timeline |
Symbol 77 Text | Uses:20 | Used by:Timeline |
Symbol 78 Text | Uses:20 | Used by:Timeline |
Symbol 79 Bitmap | Used by:80 | |
Symbol 80 Graphic | Uses:79 | Used by:Timeline |
Symbol 81 Graphic | Used by:82 | |
Symbol 82 Button | Uses:30 81 | Used by:Timeline |
Symbol 83 Graphic | Used by:84 | |
Symbol 84 Button | Uses:23 83 | Used by:Timeline |
Symbol 85 Graphic | Used by:Timeline | |
Symbol 86 Graphic | Used by:Timeline | |
Symbol 87 Text | Uses:20 | Used by:Timeline |
Symbol 88 EditableText | Uses:20 | Used by:Timeline |
Symbol 89 Bitmap | Used by:90 | |
Symbol 90 Graphic | Uses:89 | Used by:Timeline |
Symbol 91 Graphic | Used by:92 | |
Symbol 92 Button | Uses:23 91 | Used by:Timeline |
Symbol 93 Graphic | Used by:94 | |
Symbol 94 Button | Uses:30 93 | Used by:Timeline |
Symbol 95 Graphic | Used by:Timeline | |
Symbol 96 EditableText | Uses:20 | Used by:Timeline |
Symbol 97 Text | Uses:20 | Used by:Timeline |
Symbol 98 Graphic | Used by:99 | |
Symbol 99 Button | Uses:23 98 | Used by:Timeline |
Symbol 100 Graphic | Used by:101 | |
Symbol 101 Button | Uses:30 100 | Used by:Timeline |
Symbol 102 Text | Uses:20 | Used by:Timeline |
Symbol 103 EditableText | Uses:20 | Used by:Timeline |
Symbol 104 Graphic | Used by:105 | |
Symbol 105 Button | Uses:30 104 | Used by:Timeline |
Symbol 106 Graphic | Used by:107 | |
Symbol 107 Button | Uses:23 106 | Used by:Timeline |
Symbol 108 Graphic | Used by:Timeline | |
Symbol 109 Text | Uses:20 | Used by:Timeline |
Symbol 110 EditableText | Uses:20 | Used by:Timeline |
Symbol 111 Graphic | Used by:112 | |
Symbol 112 Button | Uses:23 111 | Used by:Timeline |
Symbol 113 Graphic | Used by:114 | |
Symbol 114 Button | Uses:30 113 | Used by:Timeline |
Symbol 115 Graphic | Used by:Timeline | |
Symbol 116 Text | Uses:20 | Used by:Timeline |
Symbol 117 Text | Uses:20 | Used by:Timeline |
Symbol 118 Text | Uses:20 | Used by:Timeline |
Symbol 119 Graphic | Used by:120 | |
Symbol 120 Button | Uses:23 119 | Used by:Timeline |
Symbol 121 Graphic | Used by:122 | |
Symbol 122 Button | Uses:30 121 | Used by:Timeline |
Symbol 123 Graphic | Used by:124 | |
Symbol 124 Button | Uses:123 | Used by:Timeline |
Symbol 125 Graphic | Used by:Timeline | |
Symbol 126 Graphic | Used by:127 | |
Symbol 127 MovieClip | Uses:126 | Used by:Timeline |
Symbol 128 Graphic | Used by:130 | |
Symbol 129 Graphic | Used by:130 | |
Symbol 130 MovieClip | Uses:128 129 | Used by:Timeline |
Symbol 131 EditableText | Uses:18 | Used by:Timeline |
Symbol 132 Graphic | Used by:133 | |
Symbol 133 MovieClip | Uses:132 | Used by:Timeline |
Instance Names
"hit1" | Frame 16 | Symbol 124 Button |
"target_mc" | Frame 16 | Symbol 127 MovieClip |
"gun" | Frame 16 | Symbol 130 MovieClip |
"total" | Frame 16 | Symbol 131 EditableText |
"bull" | Frame 16 | Symbol 133 MovieClip |
"bull" | Frame 16 | Symbol 133 MovieClip |
"bull" | Frame 16 | Symbol 133 MovieClip |
"bull" | Frame 16 | Symbol 133 MovieClip |
"bar" | Symbol 9 MovieClip Frame 1 | Symbol 3 MovieClip |
Special Tags
Protect (24) | Timeline Frame 1 | 0 bytes "" |
ExportAssets (56) | Timeline Frame 1 | Symbol 1 as "gunfire" |
ExportAssets (56) | Timeline Frame 1 | Symbol 1 as "gunfire" |
ExportAssets (56) | Timeline Frame 1 | Symbol 1 as "gunfire" |
ExportAssets (56) | Timeline Frame 1 | Symbol 1 as "gunfire" |
Labels
"loaded" | Symbol 9 MovieClip Frame 3 |
Dynamic Text Variables
total | Symbol 131 EditableText | "0" |
|