View Full Version : music looping, putting movie clip objects in multiple programs
neogoldenage
05-12-2010, 01:39 AM
Hello, I'm new to this forum and programming in general. I am currently working on my first true project that I would like to publish online. I have recorded background music, but have no idea on how to make the music repeat from within the code. Could anyone give me some help on the code involved? Perhaps with an explanation of the code (understanding, beggars can't be choosers).
Secondly to enhance my graphics greatly I am working with an artist on this project. I recently downloaded a disk containing all the movie clip objects I asked for, animated etc. These are in an .fla file. I can open the file and edit the objects, but not bring them into my project file without crashing or the objects becoming graphics. Are they to large? Or is there some work around?
That is all, thank you for any replies. It is great this forum exists such a great help already.
neogoldenage
05-13-2010, 04:09 PM
stop();
init();
function init(){
brain.dx = 0;
brain.dy = 0;
gravity = 0;
enemy.dx = 3;
grounded = true;
jumping = false
jumping = 8;
} //end function
brain.onEnterFrame = function(){
checkBoundaries();
move();
boundaryChecking();
AI();
} //end function
function checkBoundaries(){
if (grounded == true){
brain.dy = 0;
if (jumping == true){
brain.dy -= 8;
} //end if
} //end if
if (land0.hitTest(brain._x ,brain._y)){
grounded == true;
trace ("grounded");
}
if (land1.hitTest(brain._x ,brain._y)){
grounded == true;
}
if (land2.hitTest(brain._x ,brain._y)){
grounded == true;
}
if (land3.hitTest(brain._x ,brain._y )){
grounded == true;
}
if (land4.hitTest(brain._x ,brain._y )){
grounded == true;
} else {
gravity = 1;
trace ("falling");
} //end if
if (grounded == false){
gravity += 1;
} //end if
if (brain.hitTest(portal1._x ,portal1._y ,false)){
trace ("spring");
brain.dy -= 35;
gravity = 1;
} //end if
if (brain.hitTest(portal2)){
brain.dy += 20;
brain.dx = 0;
} //end if
if (brain.hitTest(portal3)){
brain.dy += 5;
brain.dx = 0;
} //end if
if (brain.hitTest(portal4)){
brain.dy += 5;
brain.dx = 0;
} //end if
} //end function
function move(){
brain._x += brain.dx;
brain._y += brain.dy;
brain.dy -= gravity;
if (Key.isDown(Key.RIGHT)){
brain.dx++;
if (brain.dx >= 5){
brain.dx = 5;
} //end if
} //end if
if (Key.isDown(Key.LEFT)){
brain.dx--;
if (brain.dx <= -3){
brain.dx = -3;
} //end if
} //end if
if (gravity >= 1){
gravity = 1;
} //end if
} //end function
function boundaryChecking(){
if (brain._x >= Stage.width){
brain._x = 0;
} //end if
if (brain._x <= 0){
brain._x = Stage.width;
} //end if
} //end function
function AI(){
enemy._x += enemy.dx;
if (enemy.hitTest(block)){
enemy.dx = -enemy.dx;
trace ("hit block");
} //end if
if (enemy.hitTest(block1)){
enemy.dx = -enemy.dx;
trace ("hit block1");
} //end if
} //end function
why won't this code allowing the brain sprite to float up and float down upon hitting a portal?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.