Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul
Page 18 of 18«<1415161718
Forum Login
Message << Older Topic   Newer Topic >>
7/15/2009 9:53:02   
iEnd
Member

Ok heres the deal.
I am trying to make a stat training thing:
http://megaswf.com/view/0811cf870c4ddaab5f5cff6d63d971f3.html

But I want it so that when the remaining points get down to 0, I stop adding points to the stat.

Code on the frame:

Str= 0;
Points= 3;
}
stop();





Code on the Button:

on(release){
	Str= Str+1
	Points= Points-1
}


Post #: 426
7/17/2009 15:57:48   
~JW~
Member
 

On the frame:
stop();
Str = 0;
Points = 3;
On the button
on (release) {
	Str = Str+1;
	Points = Points-1;
	if (points == 0) {
		gotoAndStop(2);
	}
}



< Message edited by ~JW~ -- 7/17/2009 15:59:22 >
Post #: 427
7/17/2009 16:15:56   
MegaPoster404
Member

actually JW, gotoAndStop gos to a different frame. It should be:

On the frame:

stop();
_root.Str = 0;
_root.Points = 3;

On the button:

on (release) {
if (_root.Points > 0) {
_root.Str += 1;
_root.Points -= 1;
}
}

< Message edited by MegaPoster404 -- 7/17/2009 16:19:19 >
DF MQ  Post #: 428
7/17/2009 16:23:23   
~JW~
Member
 

Actually, there is no need for the root to be added.
I was thinking maybe he could have a frame it
goes to when the person whose training goes
over the limit, maybe a frame that says "You
are over the limit"
Post #: 429
7/23/2009 18:41:58   
jiggibidy
Member

Well, I'm just mucking around with a few ideas for some code, and I thought I'd try a simple walking engine, using the up, down, left and right keys.
I have a mC, 'Block' with an instance name 'block' and a mC, 'Player' with an instance name, 'player'
The problem I have encountered is that when 'player' collides with 'block', 'player' always seem to go left, no matter what direction it collides with 'block' from.
I used the trace command to see what variables show up, as the variable 'facing' changes to the name of what key was pressed last, and when 'player' is colliding with 'block' the 'facing' variable seems to change to 'left' for some reason.
I've checked my code and there's nothing that states that 'facing' should be changed to 'left' in any of the code.
All of the code is in the 'player' mC:

onClipEvent (load) {
	this.speed = 5;
	this.facing = 0
}
on (keyPress "<Left>") {
	this._x -= this.speed;
	this.facing = "left"
}
on (keyPress "<Right>") {
	this._x += this.speed;
	this.facing = "right"
}
on (keyPress "<Up>") {
	this._y -= this.speed;
	this.facing = "up"
}
on (keyPress "<Down>") {
	this._y += this.speed;
	this.facing = "down"
}
onClipEvent (enterFrame) {
	trace (this.facing)
	if (hitTest(_root.block)) {
		if (this.facing = "left") {
			this._x += 5;
		}else if (this.facing = "right") {
			this._x -= 5;
		}else if (this.facing = "up") {
			this._y += 5;
		}else if (this.facing ="down") {
			this._y -= 5;
		}
	}
}

I hope you can help me with this.
AQ DF MQ  Post #: 430
7/26/2009 6:14:10   
hucki
Member

jiggi:

Your error is on this line:
if (this.facing = "left") {

1 equals sign means that it carries out the operation (sets the variable to 'left') and then does what's inside the curly brackets.
What you need to do is this:
if (this.facing == "left") {

Once you've done that, if it's facing left, the hitTest will work, however if it's not left, it will go to the next line, and set it to 'right'.
To fix this, for all the lines with an 'if' or 'else if', you need to change the question from an '=' to an '=='.

Hope this helps!

_____________________________

Dazalem - Free Online Flash Minigames
AQ DF MQ AQW Epic  Post #: 431
7/27/2009 9:58:56   
flsg
Member

*looks around*
crap I'm lazy ._.

I thought I quitted this forum lol

is eragon or somebody still here? I need their help on something big that I cant do by myself

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 432
7/27/2009 11:16:30   
hucki
Member

What do you need help with?
You're probably better than me at Flash (I've seen your work, it's really good), but I can try and help you if you want.
AQ DF MQ AQW Epic  Post #: 433
7/28/2009 8:06:39   
Vampire and Human
Member

The Reason I wish I had CS4 T_T:

http://www.bytearray.org/?p=91

Don't try this at home, kiddies.
(And by that, I mean mess with it all you want, and add it to front page!)

< Message edited by Vampire and Human -- 7/28/2009 8:07:09 >


_____________________________

OM NOM NOM'd by a Charmander!
Limits are 500px wide by 100 px tall.
Filesize at max can be 50kb.

I am a proudly eaten sig. I take pride in my half-digested-ness thank you very much!

The Mods shall not have me beat! Not again! Not this time!
AQ  Post #: 434
8/4/2009 12:19:40   
flsg
Member

^ you don't need CS4 to do that o.0
in fact, I think it's possible in flash MX, or even flash 5

neat concept though, can't believe I never thought of it

hucki: ty, but it's really complicated and involves hardcore physics lol XD
still, ty for asking

< Message edited by flsg -- 8/4/2009 12:20:56 >
AQ  Post #: 435
8/7/2009 0:17:52   
EragonZZZZ
Member

Huh. That's an interesting little demo. Nice idea for something to try to re-create.

I don't know why CS4 would be required for that. It seems doable in any language.

Anyway, flsg - ask away.

< Message edited by EragonZZZZ -- 8/7/2009 0:20:24 >
AQ  Post #: 436
8/11/2009 9:45:41   
Vampire and Human
Member

Flsg: I tried it out, and Flash couldn't open it :(
Not to mention the fact it says, "Actionscript 3 experiments..." So I just gave up from there.

< Message edited by Vampire and Human -- 8/11/2009 9:47:05 >
AQ  Post #: 437
8/15/2009 19:24:48   
flsg
Member

oh, I was saying that the code could be written in AS2 while you were talking about compatibility

eragon: you're never on msn, lol...
this might be long to explain
AQ  Post #: 438
8/16/2009 16:02:28   
EragonZZZZ
Member

Just explain it here. That's what this thread is for, anyway :P
AQ  Post #: 439
8/18/2009 9:53:02   
Vampire and Human
Member

Oh, Flsg, someone translated it to AS2, if that's what you're saying. I just have no idea how to code in AS3 (let alone AS2 [;D]) so I couldn't use/translate that one...

http://www.kylecai.com/blog/?p=47
AQ  Post #: 440
8/20/2009 11:35:09   
flsg
Member

but...but...it's a top secret super project that not even the government has access to ;_;
nah I'm just wondering if you're free right now, I feel like restarting to code a bit for a little game, or something

also, what's so good with flex? I've never used it before o.0

< Message edited by flsg -- 8/20/2009 11:42:40 >
AQ  Post #: 441
8/20/2009 19:37:52   
EragonZZZZ
Member

Eh, I'm rather busy with college-admission + senior year (summer work) + working with a C.S. guy + other stuff.

But hey, I'm still game :P
Pitch ya idea!
AQ  Post #: 442
8/21/2009 3:45:45   
flsg
Member

lmao, I'm busy with college (well special system here) too XD
just trying to spend my time in a meaniful way, instead of wasting it on playing games like I did for the past 1,5 years lol
answer my flex question plz lol

and my project is about a fighting game, trying to create a new system with some really creative controls, needs your comments
AQ  Post #: 443
Page:   <<   < prev  14 15 16 17 [18]
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul
Page 18 of 18«<1415161718
Jump to:






Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition