Shootorials #3, #4, #5 and #6 with Free Tools - mtasc and swfmill page 4

Subscribe to Shootorials #3, #4, #5 and #6 with Free Tools - mtasc and swfmill 118 posts, 16 voices

Sign in to reply


 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

how would i change the color of the score thing
never mind i got that too

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

JohannasGarden: The depths are actually a lot simpler than you think!

Note that each <place> tag is directly inside a <frame> tag which is directly inside a <clip> tag. Now, here’s the only rule that matters: when you choose depths, if two clips are <place>d in the same <frame> in the same <clip>, then they have to have different depths! If they have the same, then the second will replace the first.

So, if a <clip>’s <frame> has only one clip <place>d in it, it can have any depth: I choose 16384 just because that means it will end up as 0 in the swf file itself (which I still think is a bug, although it seems the Flash IDE secretly does something similar). If it only contains two clip placements, then those two can have any two different numbers (in which case, I have tended to choose 16384 and 16385).

Looking at it from the other perspective, if you were to place two child clips in two different parent clips, the depths are local to those parent clips, and so they can be the same. Comparing the depths of those child clips with each other is pointless; it’s the depths of the parents (or their parents, or whatever) that need to be compared.

I hope that clears it up; if it doesn’t then it’s probably because I’m bad at explaining such things! In which case, I will try harder and give some examples.

 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

how would i make a Play button that you click to make the game start

 
avatar for JohannasGarden JohannasGarden 781 posts
Flag Post

That completely makes sense—well, not in the sense that I understand everything, but in the sense that I know how to work with it. Thanks again.

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

A play button is just a movie clip with a graphic, same as the ship or any of the enemies…

 
avatar for BobJanova BobJanova 320 posts
Flag Post

I’d just like to say: THANKS for this and the other topic. I have long wanted to know if it were possible to create games for this site with free tools, and your threads combined with the Shootorials are extremely helpful. I don’t have any great game ideas at the moment, but I have got a game actually working :)

I have managed to produce a health bar (well, a general purpose score/health/activity/etc bar) in a single clip using the vector drawing stuff, which saves having a bunch of classes with nothing in them :)

 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

so how would i add bg music?

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

BobJanova: You don’t need a class file for every clip you define in the XML; just the ones that have a class attribute. If you don’t give them a class (which extends MovieClip) then the clip will instead be of the exact class MovieClip (kinda like a default, I suppose).

ETHANR26: Music and sounds are basically the same. http://www.explodingferret.com/hosted/shoot/Sounds.xml is an example of how to import sounds into swfmill. If you search through the first post in this thread you should find some information on how to encode the files so that they work correctly. Once they’ve got IDs in the XML, they can be used from actionscript the same way as any other sound, so just use any guide you can find for that.

 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

thanks ill get on that
how could i make the music loop?

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

I don’t know; that’s really an ActionScript issue. Try asking about it in the Programming forum.

 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

i give up for now im too tired

 
avatar for ETHANR26 ETHANR26 543 posts
Flag Post

so do you know how to stop music?

 
avatar for MES13 MES13 53 posts
Flag Post

How do you get your healthMeter bar to work. I get it to where it shows up on the stage but it doesnt scale like it should.

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

Can you describe how it behaves, and post the relevant xml and as2 snippets?

 
avatar for MES13 MES13 53 posts
Flag Post
<?xml version="1.0" encoding="UTF-8" ?> - <movie height="300" width="600"> <background /> - <frame> <clip /> <clip /> <clip class="Missile" /> <clip class="enemy" /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> <clip /> - <library> <clip class="Ship" /> <clip class="Missile" /> <clip class="enemy" /> <clip class="EnemyMissile" /> - <clip class="Explosion"> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> - <frame> <place /> </frame> </clip> - <clip> - <frame> <place /> <place /> <place /> </frame> </clip> - <clip class="Background"> - <frame> <place /> <place /> </frame> </clip> </library> <place /> <place /> <place /> <place /> </frame> </movie> That is the XML.
 
avatar for MES13 MES13 53 posts
Flag Post

function updateHealth(points)
{
health += points;
root.healthMeter.bar.xscale = health;
}

function resetHealth()
{
health = 100;
root.healthMeter.bar.xscale = 100;
}
That’s in the ship class.

function onEnterFrame()
{
_x += speed;

if(this.hitTest( _root.ship) )
{
this.removeMovieClip();
_root.ship.updateHealth(-10);
}
that’s in the enemyMissile class

if(this.hitTest(_root.ship))
{
_root.ship.updateHealth(-20);
explode();
}
and thats in the enemyShip class

 
avatar for MES13 MES13 53 posts
Flag Post

It will appear on stage but when I get shot by an enemy missile or get hit by an enemy it doesnt make the health bar go down or scale down. it just sits there

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

Your xml got destroyed by the board formatting system, can you put it on a pastebin, then link to it?

 
avatar for MES13 MES13 53 posts
Flag Post

Ok i got past the health. It scales down. I’m stuck with the reward points. I talked to ethanr26 about it and he said there is no way to make it work. Is there anyway to make it work???

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

I’m not sure what you mean by “reward points”. Do you mean some kind of score system, or some kind of upgrade system, or … ?

 
avatar for MES13 MES13 53 posts
Flag Post

It was the text field that came up after killing an enemy but its solved now. I need help with the shield that supposed to come up when you pick up a certain power up. I cant get it to display my shield.

 
avatar for MES13 MES13 53 posts
Flag Post

I tried using a method that was on this post but it still didnt work. Any suggestions??

 
avatar for explodingferret explodingferret 1350 posts
Flag Post

Can you pastebin the xml now? It’s impossible to help without details.

 
avatar for MES13 MES13 53 posts
Flag Post

Yeah
This is where i uploaded them
http://www.mediafire.com/?sharekey=acb14a7a18f0f21de5c3dee5769931ece04e75f6e8ebb871

 
avatar for MES13 MES13 53 posts
Flag Post

My swfmill keeps freezing up on me. Is it because of the XML or something in the code

Sign in to reply


Click Here