RE: Flash Q&A thread 3 (Full Version)

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



Message


SirSchmoopy -> RE: Flash Q&A thread 3 (7/29/2007 10:46:09)


quote:

ORIGINAL: flsg

EragonZZZZ: thanks for your help, I didn't feel the need to write this simple code
BTW, SirSchmoopy, why do you use a hitTest for a turn-based RPG like AQ? Is that nessesary?
eragon just showed you the code I was trying to explain to you in 3 lines
now do you know what I'm talking about? You used 10 if() while with a little bit of thinking you could reduce it to 10. That's what I call basic
but I DO feel the need to re-release my bubble's adventure. Just to show you how a RPG is done(mine isn't big or great, but I'm sure it's THE game that got the most hits and replies in GoGA)

And one last word, just because I used Fae's avatar doesn't mean I'm a girl >.<


dominic_r_monroe: use Kirupa.com


omfg.....who ever said i was making an rpg like AQ??????????? im making a different kind, cuz my friend duznt like turn based. and when im don e with this THEN i make a turn based rpg again, but for now, my friend requested a diff kind of game.
i can EASILY make turn based, and if i was making turn based, i might not need any help, no offense, cuz i practice it ALOT...




flsg -> RE: Flash Q&A thread 3 (7/29/2007 10:56:40)

SirSchmoopy:
ok then I misunderstood your code, it's just that everone here wants to make a turn-based RPG
and read eragon's post, that'll calm you down XD
everyone can easily make a turn-based game, but the problem is how to make a good one. Search in GoCA and you'll find tons of them
you practice a lot and uses 10 conditional statements while they could be reduced to 1?...

ok then: I challenge you to make a better game than my bubble's adventure, too bad you can't see it now(ok just joking)

eragon: lol never thought of that




SirSchmoopy -> RE: Flash Q&A thread 3 (7/29/2007 10:58:18)


quote:

ORIGINAL: flsg

SirSchmoopy: everyone can easily make a turn-based game, but the problem is how to make a good one. Search in GoCA and you'll find tons of them
you practice a lot and uses 10 conditional statements while they could be reduced to 1?...

ok then: I challenge you to make a better game than my bubble's adventure, too bad you can't see it now(ok just joking)

eragon: lol never thought of that

actually, im looking at it right now in my second tab..... i played it before i ever joined the forum, seeing that is wht made me come to this q&a




EragonZZZZ -> RE: Flash Q&A thread 3 (7/29/2007 11:13:36)

quote:

ORIGINAL: SirSchmoopy
i can EASILYmake turn based, and if i was making turn based, i might not need any help, no offense, cuz i practice it ALOT...


*coughs*
*COUGHS*

So, wait. You're telling me you can easily do what took zhoom about 2 years running?
When you use 10 if statements to do what three lines of code can accomplish?





SirSchmoopy -> RE: Flash Q&A thread 3 (7/29/2007 11:35:18)


quote:

ORIGINAL: flsg
you practice a lot and uses 10 conditional statements while they could be reduced to 1?...

thats cuz i LIKE doing more AS. i dont make games cuz theyre fun i make games cuz i think making games is fun. Also, more AS makes me feel special :).




EragonZZZZ -> RE: Flash Q&A thread 3 (7/29/2007 11:45:26)


quote:

ORIGINAL: SirSchmoopy
thats cuz i LIKE doing more AS. i dont make games cuz theyre fun i make games cuz i think making games is fun. Also, more AS makes me feel special :).


oh my god...
That is one of the....
...
....
.....
wow...
I'm totally speechless here.

I've never ever met a programmer who was a FAN of anti-optimization.
I've met people who are optimization freaks, some who try to do it occasionally, some who never do it, some who think it's a waste of time...
But never anyone who tried to make programs less optimized.
flsg? You hearing me on this one?




flsg -> RE: Flash Q&A thread 3 (7/29/2007 12:05:52)

hey I was making something for my new gallery lol
SirSchmoopy: I'm with you, except that I like more AS, but when they actually MEAN something, not just some code duplications XD
if you want to, I could enlarge x10 again your code, want me to show you how?




SirSchmoopy -> RE: Flash Q&A thread 3 (7/29/2007 12:06:58)

yes plz ty[sm=animal-smiley-025.gif]




flsg -> RE: Flash Q&A thread 3 (7/29/2007 12:33:32)

ok, you asked for it(I hope this junk won't crash your computer):
var tempRoot:MovieClip = _root;
tempRoot.stop();
var monsterMC:Array = new Array(tempRoot.monsterName);
init();
MovieClip._prototype_.myHitTest = function(mcName:MovieClip):Boolean  {
	return this.hitTest(mcName);
};
if (tempRoot === _root) {
	tempRoot.onEnterFrame = function() {
		for (var i:Number = 0; i<=100; i++) {
			for (var j:Number = 0; j<=50; j++) {
				for (var k:Number = 0; k<monsterMC.length; k++) {
					if (_parent.wep.myHitTest(tempArray[k])) {
						if (this.die === Number(1)) {
							tempRoot.monsterHP = tempRoot.monsterHP-1;
						} else if (this.die === Number(2)) {
							tempRoot.monsterHP = tempRoot.monsterHP-2;
						} else if (this.die === Number(3)) {
							tempRoot.monsterHP = tempRoot.monsterHP-3;
						} else if (this.die === Number(4)) {
							tempRoot.monsterHP = tempRoot.monsterHP-4;
						} else if (this.die === Number(5)) {
							tempRoot.monsterHP = tempRoot.monsterHP-5;
						} else if (this.die === Number(6)) {
							tempRoot.monsterHP = tempRoot.monsterHP-6;
						} else if (this.die === Number(7)) {
							tempRoot.monsterHP = tempRoot.monsterHP-7;
						} else if (this.die === Number(8)) {
							tempRoot.monsterHP = tempRoot.monsterHP-8;
						} else if (this.die === Number(9)) {
							tempRoot.monsterHP = tempRoot.monsterHP-9;
						} else if (this.die === Number(10)) {
							tempRoot.monsterHP = tempRoot.monsterHP-10;
						} else if (this.die === Number(11)) {
							tempRoot.monsterHP = tempRoot.monsterHP-11;
							switch (this.die) {
								case 1 :
									trace("1");
									break;
								case 2 :
									trace("2");
									break;
								case 3 :
									trace("3");
									break;
								case 4 :
									trace("4");
									break;
								case 5 :
									trace("5");
									break;
								case 6 :
									trace("6");
									break;
								default :
									trace("nothing");
							}
						}
					}
				}
			}
		}
	};
}
var intt:Number=setInterval(function(){this.die=tempRoot.die=_root.die},1);
trace(this.die+", :"+tempRoot.monsterName);
if (tempRoot.monsterName == _root.monsterName) {
	for (var i:Number = 0; i<=100; i++) {
		this.die++;
		this.die--;
		for (var j:Number = 0; j<=50; j++) {
			monsterName.onEnterFrame = function() {
				if (this.hitTest(_parent.wep) === _parent.wep.myHitTest(tempRoot.monsterName)) {
				var newObj:Object=new Object()
				newObj.prop1=tempRoot.monsterName
				if(tempRoot.monsterName==undefined){
				_root.createEmptyMovieClip("monster", 999)
				}else{
				trace(die)
				}
			
				}
			};
			for (var k:Number = 0; k<monsterMC.length; k++) {
			}
		}
	}
}

I didn't have the time for all the code, sorry




EragonZZZZ -> RE: Flash Q&A thread 3 (7/29/2007 12:46:41)

The sheer inefficiency of that code made my eyes melt.




SirSchmoopy -> RE: Flash Q&A thread 3 (7/29/2007 12:47:43)

hurray!!! (not about ur eyes melting about the code!)




EragonZZZZ -> RE: Flash Q&A thread 3 (7/29/2007 14:06:39)

flsg, in need of a good site for learning about using bitmapdata in flash 8, AS 2.0
kay thanks :D




Umbrix -> RE: Flash Q&A thread 3 (7/29/2007 18:05:19)

flsg, thanks for the fire tut. That's pretty cool. But....I was kind of wondering how to make the simpler, AQ-like fire :P. I would -assume- it's easier than that tut :P




flsg -> RE: Flash Q&A thread 3 (7/30/2007 8:59:43)

Umbrix: AQ staff draw the fire themself, so if you want to make a fire like theirs, you need animation skills
EragonZZZZ: humm....kirupa.com? XD




EragonZZZZ -> RE: Flash Q&A thread 3 (7/30/2007 23:36:55)

Nahh..never mind, taught myself again :]
I love bitmaps now.
Efficient collision detecting (without using a bitmap hitTest I might add), terrain creation/destruction...awesome.




Grie Velorn -> RE: Flash Q&A thread 3 (7/31/2007 17:58:51)

hey yea umm i need some help im not sure if this is only an as ting or not but here it goes when i try to import a .mp3 file into flash it keeps saying it cant be read...i've tried about 500 different files and they arnt working any suggestions?




flsg -> RE: Flash Q&A thread 3 (7/31/2007 20:09:22)

did you imported it with AS?
according to the error it's not, you got an error when you imported manually right?




Grie Velorn -> RE: Flash Q&A thread 3 (7/31/2007 21:16:37)

yes i would goto file>Import>Import to Library but it wouldn't work(im trying to make a music vid)




swenn -> RE: Flash Q&A thread 3 (8/1/2007 4:07:37)

I need some help with the folowing code, its for an top view game, with rotation
onClipEvent(load)
{
	speed = 1;
	angle = 30;
}
 
onClipEvent(enterFrame)
{
	if (Key.isDown(Key.UP))
	{
		xx = math.cos(_rotation*Math.PI/180)*speed;
		yy = math.sin(_rotation*Math.PI/180)*speed;
		this._x += xx;
		this._y += yy;
	}
	else if (Key.isDown(Key.LEFT))
	{
		this._rotation -= angle;
		
	}
	else if (Key.isDown(Key.RIGHT))
	{
		this._rotation += angle;
	}
}


It does rotate but doesnt go forward( I got the math functions from a tutorial).WHat is wrong?Also, how do I make it go smoother, so no direct respose but after a while(Like a ship)




Nicky -> RE: Flash Q&A thread 3 (8/1/2007 7:14:17)

Hey there, I was wondering, how do I create a statement (Actionscript 2.0), that, when triggered, goes to a certain frame, and plays until another frame.

For example:
I have 5 frames, and when the trigger(some kind of button or something) is pressed, it plays frame 1-3.

Also, if anyone has a Macintosh computer, how do you insert actionscript? I know on PCs it's F9, right? If anyone had a Mac, I was just wondering how to get into it. Unless there's a menu option, next to file and edit and stuff, cause it might be similar in that case.
(I have tried F9, and it didn't work.)

Probably an easily answered question, but I'm new to flash ^^;.
If I didn't explain this properly, I'll try and repost it with a better explanation.




flsg -> RE: Flash Q&A thread 3 (8/1/2007 11:34:53)

Nicky: to use the action panel, go to window-action XD lol
and put a stop() function at the third frame. When you press to button, use gotoAndPlay(startingframe)
the startingframe is 1 in your case

swenn: math.cos(_rotation*Math.PI/180)*speed returns NaN(Not a Number), because you forgot to put an upper-case M to Math!!! So AS can't find the math object and can't use cos and sin. use Math.cos(.....)




swenn -> RE: Flash Q&A thread 3 (8/1/2007 11:48:00)

Thanks, it does move now.. but it doesnt move very right :S is there a way to make it better?So it moves smoother and that it will always move into the direction of the front part?(fixed tht part, just smoothing now)
Just thanks:D but now for part two...
can you explain the sin and cos?I dont get what they stand for?




flsg -> RE: Flash Q&A thread 3 (8/1/2007 12:07:21)

well you should always understand you own code XD
you'll learn this in secondairy school
they calculate the x and y length compared to the hypotenuse of the triangle and its angle and return the proportion




swenn -> RE: Flash Q&A thread 3 (8/1/2007 12:25:33)

Hmm I think I get it.. Here it is just called different:P

now my next problem(Am I irritating already? :P)
onClipEvent(load)
{
	speed = 3;
	angle = 10;
	Bulletshot=false;
	Bulletspeed= 50;
}
 
onClipEvent(enterFrame)
{
	if (Key.isDown(Key.UP))
	{
		xx = Math.cos(_rotation*Math.PI/180)*speed;
		yy = Math.sin(_rotation*Math.PI/180)*speed;
		this._x += xx;
		this._y += yy;
	}
	
	if (Key.isDown(Key.LEFT))
	{
		this._rotation -= angle;
		
	}
	else if (Key.isDown(Key.RIGHT))
	{
		this._rotation += angle;
	}
   if(Key.isDown(Key.DOWN) && Bulletshot == false)
   {attachMovie("bullet", "bulletshoot", 8);
   bulletshoot._x +=  Math.cos(_rotation*Math.PI/180)+Bulletspeed;
   bulletshoot._y +=  Math.sin(_rotation*Math.PI/180)+Bulletspeed;
   Bulletshot= true;
   
   }
	}


Its a code to make it shoot.. but it wont work:S what is wrong?




flsg -> RE: Flash Q&A thread 3 (8/1/2007 17:52:53)

swenn:after fireing once, Bulletshot become true, and in your if statement, you command it to shoot only if Bulletshot is false...
plus, did you check that you have a MC with the linkage name "bullet"?
plus, EVEN if you correct what I tell you, your bullet always uses the same depth 8, and since one depth can only have one thing, you previous bullet will dissapear if you shoot again(which attach the movie and assign it the depth 8 and erase the previous bullet)




Page: <<   < prev  12 13 [14] 15 16   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.15625