14,574 Forum Posts by "Denvish"
At 3/16/09 05:30 PM, koliski wrote: i just need one more thing ok i made a animated man walking and i type the code and he aint walking when i press it plese help
You don't need code for an animation of a man walking
If you want to learn code, check out the thread that StaliN98 linked
AS: Preloader by Snubby
AS: Preloader
At 3/16/09 05:29 PM, deckheadtottie wrote: 192.168.1.100
192.168.0.99 actually, but I'll forgive you seeing as it's your burfday
At 3/16/09 05:25 PM, deckheadtottie wrote: TWO PAGES. OH BOY
127.0.0.1
At 3/16/09 05:20 PM, Kevinkdragon wrote: Does anyone here use anime studio?
Nope
Yay for dht, errrrrrr and happy birthday ya bugger
At 3/16/09 05:06 PM, ReNaeNae wrote: YAY!!! :D
Does this mean we get his drunken posts and broadcasts again?!?!
You never know. Hell, I don't know. Wait, where am I again?
At 3/16/09 04:53 PM, Objection wrote: I haven't seen his name in the mod list yet, but I assume that it will be updated in good time.
Who the fuck is Denvish?
At 3/16/09 12:11 PM, snorte wrote: Thanks alot. That worked out well.:) As always when a problem occur i tend to lock myself into one specific area that i think needs to be modified to make it work. xD I need to learn to broaden my mind i bit. Thanks alot again.:)
NP. The other alternative, if you want to keep actions all on the main timeline is to set up an onEnterFrame scan to see whether the attack animation's _currentframe is equal to its _totalframes (only while P1punch is true)
At 3/16/09 12:00 PM, Denvish wrote: _root.P1Punch=false;
*correction
_root.P1punch=false;
At 3/16/09 11:53 AM, snorte wrote: function P1ATTACK() {
if(Key.isDown(65) && P1punch) {
mc.gotoAndStop("player1Punch");
P1punch = false;
}
if(!Key.isDown(65) && !P1punch) {
mc.gotoAndStop("player1Idle");
P1punch = true;
}
}
Not really sure why you'd need the second lump of P1ATTACK, it'd make more sense to just use
function P1ATTACK() {
if(Key.isDown(65) && !P1punch) {
mc.gotoAndStop("player1Punch");
P1punch=true;
}
}
and then add some actions to the last frame of the attack animation, something along the lines of
_root.P1Punch=false;
_root.mc.gotoAndStop("player1Idle");
At 3/16/09 11:34 AM, snorte wrote: The problem I have right now is that when i click "a" on my keyboard, which is the button that realeases the punching animation, the punch-animation will naturally start it's animation but as soon as I release the "a"-button it goes back to idle-stance.
You're going to have to post the code you're using
And aswell as fullfilling the animation i want to make it impossible to do anything else while this animation is rolling. Thanks in advance for any help. :)
You need a boolean (true/false variable) for that, eg 'punching'. Set it to true when the punch starts and reset it to false when the punch finishes. Then check that boolean on all other trigger/keypresses, and if it's true than don't run the other code.
At 3/16/09 11:31 AM, tcc85811 wrote: I can have up to 4 enemies on the screen at once, and each one enters the screen from their own corner.
I'm trying to place them in their respective corners by putting the following code in the onClipEvent(load) area:
if(name == E1){
_y = 150;
_x = Stage.width + 150;
}
if(name == E2){
_y = 250;
_x = Stage.width + 150;
}
if(name == E3){
_y = 150;
_x = -150;
}
if(name == E4){
_y = 250;
_x = -150;
}
When I do this, all 4 enemies get placed in the E4 position, even though they all have the correct names.
This problem gets fixed by placing 'else' between the if statements, but WHY? There should be no need for an 'else' anywhere in this code. Why do they all follow the last if statement?
If you're trying to grab the instance's _name then you need to use
if(_name=="E1"){
If 'name' is your own variable, then you're looking for trouble, because both 'name' and _name' are reserved by Flash. Use 'nam' or something instead.
In terms of the else, it's actually more efficient in this case to useif else rather thanif in this case, because if the first condition is true, it won't have to check the others
Rename the extension (eg from filename.swf to filename.old), zip it, and email it with instructions to rename the extension at the other end. Works with GMail.
function randomHelp(){
while(Help==lastNum){
Help=int(Math.random()*10);
}
lastNum=Help;
}
At 3/15/09 04:40 PM, Zyphonee wrote: I actually wrote that one myself.
For AS2:
Flash Newbie Help by -ArcticHigh-
Flash (noob) tutorial by -hellraiser-
Starting with Flash by Otacon
NG's best tutorial movies
Flash tuts list by AGH
Flashkit
actionscript.org
AS: Main
Kirupa
good-tutorials.com
For AS3, not sure, but have a look at AS3: Main
At 3/12/09 02:02 AM, henke37 wrote: This sounds like a good time to not use hittest and learn how to do it with simple math.
How exactly does this post help the topic starter? If you're going to advocate using maths over hitTests, at least give some basic pointers/code samples on how he could achieve what he wants to do. Saying 'use simple math' is about as useful as saying 'have a waffle for breakfast'.
Don't use Scenes, they just complicate games
The apples/roses keep appearing because the _root.onEnterFrame function hasn't been stopped.
Add a _root.onEnterFrame=null; to the game over code, then send the main timeline playhead to the game over frame, which should have the Frame Label (for this code) of fin
ie, replace the FALL function with this
function FALL(mc){
mc.yvel+=gravity;
mc._y+=mc.yvel;
if(mc.hitTest(bucket)){
score+=10;mc.removeMovieClip();
}else if(mc._y>Stage.height+mc._width){
lives--;mc.removeMovieClip();
if(lives<=0){
_root.onEnterFrame=null;
gotoAndStop("fin");
}
}
}
Bucket MC on stage Instance Named 'bucket'
Apple MC in library set for AS Export and Linkage Named 'apple'
Two dynamic textboxes, vars: 'score' and 'lives'
This code, main timeline:
gravity=1;
score=0;
lives=25;
appleFreq=40;
appleCheck=0;
appleDepth=500;
_root.onEnterFrame=function(){
MOVEBUCKET(bucket);
appleCheck++;
if(appleCheck>=appleFreq){MAKEAPPLE();}
}
function MOVEBUCKET(mc){
mc._x=_xmouse;
mc.w=mc._width/2;
if(mc._x>Stage.width-mc.w){mc._x=Stage.width-mc.w;}
if(mc._x<mc.w){mc._x=mc.w;}
}
function MAKEAPPLE(){
var bw=bucket._width;
appleCheck=0;
appleDepth++;
if(appleFreq>5){appleFreq-=0.5;}
if(gravity<2){gravity+=0.02;}
newA=attachMovie("apple","a"+appleDepth,appleDepth);
newA._x=(bw/2)+random(Stage.width-bw);
newA._y=-bw/2;
newA.yvel=1;
newA.onEnterFrame=function(){FALL(this);}
}
function FALL(mc){
mc.yvel+=gravity;
mc._y+=mc.yvel;
if(mc.hitTest(bucket)){
score+=10;mc.removeMovieClip();
}else if(mc._y>Stage.height+mc._width){
lives--;mc.removeMovieClip();
}
}
15 minutes. Please spend a little time trying to understand how and why it works.
At 3/11/09 12:24 AM, Gustavos wrote: I realised that the frame where the swf stops didn't have the "stop;()"
Correct syntax is stop();
Would suggest arrow key support as well as WASD. Otherwise, seems pretty smooth, with no obvious bugs.
At 3/8/09 09:43 PM, Gustavos wrote:
Error opening URL "file:///
http/:"
Looks like it's trying to call a http path (which is not correct - use http://), although since you're a local load anyway (file:///), the http is irrelevant. If it's part of your fla name, rename the fla
What is the fla name, and what are your actions on the button(s)?
Really not sure. Try
Samurai_Sword.removeMovieClip();
Flash Newbie Help by -ArcticHigh-
Flash (noob) tutorial by -hellraiser-
Starting with Flash by Otacon
NG's best tutorial movies
Flash tuts list by AGH
Flashkit
actionscript.org
AS: Main
Kirupa
good-tutorials.com
At 3/9/09 03:43 PM, ConnorProgrammer wrote: does anyone know some code so that an enemy continuesly moves towards a player?
AS: Movement - Basic
AS: Pointing/Shooting at Mouse
AS: Rotate and Follow Mouse by UnknownFury
on (press) {
i++;
nmc=this.attachMovie("Squirrel","Squirrel"+i,_root.getNextHighestDepth());
nmc.onEnterFrame=function(){
//DO STUFF
}
}
At 3/9/09 04:10 AM, kickassman1 wrote: function CheckForWeapon() {
if (Xen.hitTest("Samurai_Sword") and Xen.crouch) {
removeMovieClip("Samurai_Sword");
Xen.attachMovie("Samurai_Sword","weapon"
,9);
Xen.gotoAndStop("PickUp");
Xen.pickup = true;
Xen.weaponheld = true;
}
}
The sword actually has the Instance Name "weapon" when you attach it, not "Samurai_Sword". So as far as I can see, you should be using
weapon.removeMovieClip();
rather than
removeMovieClip("Samurai_Sword");
Also, as Patcoola says, if the weapon wasn't attached with AS in the first place, you'll need to do a swapDepths(78910); first to make it accessible for the deletion
Either
on (press) {
i++;
this.attachMovie("Squirrel", "Squirrel"+i, _root.getNextHighestDepth(), {_x:300,_y:300});
}
or
on (press) {
i++;
nmc=this.attachMovie("Squirrel", "Squirrel"+i, _root.getNextHighestDepth());
nmc._x=300;nmc._y=300;
}
At 3/8/09 02:06 PM, amartainment wrote: Hey NG userz,
I needed some help for hitTest. Its not very accurate, in my game too, it shows mission failed sometimes when therez no 'actual' contact. Is there any replacement? or any way to solve it? Please help me.
~Amar
You could go for having an internal, invisible Movieclip inside which you use for the hitTest.
Or, you could use shapeflag hitTesting - see
AS: Collision Detection by BleeBlap
AS: Collisions - HitTesting Duped MCs by SpamBurger
AS: Collisions - Move To Contact by Tela_Ferrum
Or, you could scrap hitTesting and go for trigonometry

