|
metadata
I was doing all the things, step by step, and suddenly I cant go on:
I put all the code for the miniboss, in his class and in the ship class. When I preview the game the miniBoss doesn’t came so… Please help me!
|
|
|
metadata
Did you link the miniboss movie clip to the miniboss class file and name the miniboss correctly (the “export for actionscript” thing).
|
|
|
metadata
Yes I did: The name of the MiniBoss MC is “MiniBoss” and the class name is “MiniBoss”. In the Linkage its all the same, “MiniBoss” the Identifier and “MiniBoss” the Class
|
|
|
metadata
try putting trace statements, such as:
trace( "boss timer set to " + bossTimer );
trace( “about to spawn miniboss” );
|
|
|
metadata
bleh. I have another problem with this shootorial (#7) similar. My powers ups doesnt come!
|
|
|
metadata
|
|
|
metadata
Obviously you broke something. First step is to hit undo a bunch of times until it works again.
If that doesn’t work (i.e. too much to undo or you saved or whatever), then start putting trace statements. Look through the scripts: where (in the code) does the powerup spawn? Where is it getting placed on the screen (powerup.x and powerup.y vars)? Does it have speed? Is it actually spawning (trace statement in the powerup.as file’s OnLoad function)?
|
|
|
metadata
Ill check it and then I’ll let you know if it worked. I’ll post the error too.
|
|
|
metadata
function onLoad()
{
speed = 3;
type = Math.floor(Math.random()**3+1);
\_x = 690;
\_y = Math.random()** 200+50;
}
This is the OnLoad Function of the PowerUp. I cant see anything wrong in it…
|
|
|
metadata
powerupTimer += 1;
if(powerupTimer \> 150)
{
powerupTimer = 0;
var powerup = \_root.attachMovie(“PowerUp”, “PowerUp” + \_root.getNextHighestDepth(), \_root.getNextHighestDepth());
}
And heres the Enterframe function to the powerupTimer.
|
|
|
metadata
lol i got no idea wat you guys are talking about but someone help me make a game plzzzz
|
|
|
metadata
I’ve replaced the old Ship.as (from Shootorial 6) and restarted from zero of the Shootorial 7. In the end, after some repairs and modifys, I made a power up with Nuke, Shield and Health. Thanks everyone!
|
|
|
metadata
maitie vodkid make a topic please
|
|
|
metadata
I have a very strange problem with Shootorial #7. I’m up to the stage once the Power Ups, Shield and Mini Boss have been completed, but before moving on the the main Boss. There’s a point here at which the Shootorial tells you to check your swf, which I have done, only when loading all I get is the Game Over screen, and the play again button doesn’t function.
I step back to the end of the Power Up bit, and everything’s fine. I’ve gone over the steps around 4 or 5 times now, tried every suggestion in the comments yet nothing seems to work! I’m very desperate to get on with this soon, so any help would be greatly appreciated…
|
|
|
metadata
That could be the result of scripting errors. There is a box in CS4 that shows you the errors. Re-check your script, that must be your problem.
|
|
|
metadata
As in, “Compiler Errors”? Nope, everything’s fine apparently. I’ve just run through the instuctions from the start of Shootorial #7, and the same thing has happened! It’s obviously something I’m doing worng, but I can’t figure out what…
|
|
|
metadata
Perhaps if I were to put the a link to the published swf so you can see what I mean… would that help?
|
|
|
metadata
Ok post your entire Ship.as here. Use "
` as a prefix and “`” To end the code.
|
|
|
metadata
use pre between \<\> to post the grey box on forum (codes) and /pre between \<\> to end the box.
|
|
|
metadata
`"class Ship extends MovieClip
{
var velocity;
var shootLimiter;
var enemyTimer;
var enemies;
var score;
var health;
var powerupTimer;
var miniBossTimer;
function onLoad()
{
velocity = 10;
shootLimiter = 0;
enemyTimer = 0;
enemies = [];
resetHealth();
resetScore();
powerupTimer = 0;
miniBossTimer = 0;
_root.ship.shield._visible = false;
_root.enemyHealthMeter._visible = false;
_root.gameOverMenu._visible = false;
_root.gameOverMenu.playAgainButton.onPress = function()
{
_root.ship.newGame();
}
}
function newGame()
{
this._visible = true;
_root.gameOverMenu._visible = false;
resetHealth();
resetScore();
resetKills();
resetMisses();
resetvelocity();
resetshootLimiter();
resetpowerUpTimer();
resetenemyTimer();
resetminiBossTimer();
}
function updateHealth(points)
{
health += points;
_root.healthMeter.bar._xscale = health;
if(health < 1)
{
health = 0;
_root.gameOverMenu._visible = true;
explode();
}
}
function explode()
{
this._visible = false;
var explosion = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
explosion._x = _x;
explosion._y = _y;
for(var i in enemies)
enemies[i].explode();
}
function resetHealth()
{
health = 100;
_root.healthMeter.bar._xscale = 100;
}
function resetScore()
{
score = 0;
_root.scoreText.text = score;
}
function updateScore(points)
{
score += points;
_root.scoreText.text = score;
}
function onEnterFrame()
{
if(_visible == true)
{
shootLimiter += 1;
if( Key.isDown(Key.RIGHT) )
{
_x = _x + velocity;
}
if( Key.isDown(Key.LEFT) )
{
_x = _x - velocity;
}
if( Key.isDown(Key.UP) )
{
_y = _y - velocity;
}
if( Key.isDown(Key.DOWN) )
{
_y = _y + velocity;
}
}
if( Key.isDown(Key.SPACE) && shootLimiter > 5)
{
shootLimiter = 0;
var missile = _root.attachMovie( "Missile", "Missile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
missile._x = _x + 50;
missile._y = _y + 2;
}
enemyTimer += 1;
if(enemyTimer > 60)
{
enemyTimer = 0;
var enemy = _root.attachMovie( "EnemyShip", "EnemyShip" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(enemy);
}
if(!_root.miniBoss)
miniBossTimer += 1;
if(miniBossTimer > 300 )
{
miniBossTimer = 0;
_root.attachMovie("MiniBoss", "miniBoss", _root.getNextHighestDepth());
enemies.push(_root.miniBoss);
}
powerupTimer += 1;
if(powerupTimer > 150)
{
powerupTimer = 0;
var powerup = _root.attachMovie("PowerUp", "PowerUp" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
}
if(_root.ship.shield._visible == true)
{
_root.ship.shield._alpha -= .5;
if(_root.ship.shield._alpha < 0)
{
_root.ship.shield._visible = false;
_root.ship.shield._alpha = 100;
}
}
}
}`
Hope I’ve done that right, sorry I took so long!
|
|
|
metadata
Man this script is super incomplete. In new game function you call resetvelocity(), resetshootLimiter(), and other resets, but there are no functions called that on the Ship script!
|
|
|
metadata
Can you help at all? I’ve been through tyring to find what I’ve missed and referred to the complete Ship.as included in the download…
|
|
|
metadata
I suggest you go on shootorial 0 and 1 and restart all you ship.as.
|
|
|
metadata
I’ve been through the whole thing again and it still comes out the same! I don’t suppose there’s any chance someone would be willing to fill in the bits I’ve missed in the script I’ve posted above? Some of the variables and resets in that version I’d added-in because they were in the final Ship.as, and I thought they might be what I was missing…
|
|
|
metadata
OK, in the first page of the shootorial 1, there is a link to download the source of the shootorial. Download it, and you will have the entire script and lesson of shootorial 1. Keep make comparissions of you script and theirs and see whats wrong.
|