RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


iEnd -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/15/2009 9:53:02)

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
}






~JW~ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/17/2009 15:57:48)

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





MegaPoster404 -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/17/2009 16:15:56)

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;
}
}




~JW~ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/17/2009 16:23:23)

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"




jiggibidy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/23/2009 18:41:58)

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.




hucki -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/26/2009 6:14:10)

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!




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/27/2009 9:58:56)

*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




hucki -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/27/2009 11:16:30)

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.




Vampire and Human -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/28/2009 8:06:39)

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!)




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/4/2009 12:19:40)

^ 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




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/7/2009 0:17:52)

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.




Vampire and Human -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/11/2009 9:45:41)

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.




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/15/2009 19:24:48)

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




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/16/2009 16:02:28)

Just explain it here. That's what this thread is for, anyway :P




Vampire and Human -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/18/2009 9:53:02)

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




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/20/2009 11:35:09)

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




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/20/2009 19:37:52)

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!




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (8/21/2009 3:45:45)

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




Page: <<   < prev  14 15 16 17 [18]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.1396484