佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1627|回复: 8

[分享] 一个烟火效果

[复制链接]
发表于 31-12-2004 11:29 AM | 显示全部楼层 |阅读模式
Flash: http://img.photobucket.com/albums/v614/emilccp/Untitled-1.swf

只要点击一下中间的红点就可以了

还有路过的高手如:番茄或章鱼
如果我想做只要按滑鼠就可以放出烟火,而烟火是独立的不会跟着滑鼠
应该怎么做呢

[ Last edited by emilccp on 31-12-2004 at 11:31 AM ]
回复

使用道具 举报


ADVERTISEMENT

发表于 31-12-2004 01:16 PM | 显示全部楼层
简单弄了一个,我想应该是你想要的

Flash: http://xenz.flash8.net/examples/firework.swf

MovieClip.prototype.onFire = function(x, y) {
        for (var i = 0; i<30; i++) {
                var depth = this.getNextHighestDepth();
                var fire = this.attachMovie("firework", "firework"+depth, depth);
                var myColor = new Color(fire);
                myColor.setRGB(_root.c[this.count]);
                delete myColor;
                fire._x = x;
                fire._y= y;
                fire._xscale = fire._yscale=25+random(75);
                fire._rotation = random(10)+i*11;
        }
        this.count++;
        if(this.count >3) {
                clearInterval(this.time);
        }
}

onMouseDown = function() {
        var obj = this.createEmptyMovieClip("f"+this.getNextHighestDepth(), this.getNextHighestDepth());
        obj.count = 0;
        obj.onFire(_xmouse, _ymouse);
        obj.time = setInterval(obj, "onFire", 1300, _xmouse, _ymouse);
}

var c = new Array(0x66FF00, 0xFF00CC, 0x3333FF, 0xFFFF00);

源文件 http://xenz.flash8.net/examples/firework.rar
回复

使用道具 举报

发表于 31-12-2004 01:34 PM | 显示全部楼层
if(this.count > _root.c.length-1) {  //换成这样比较方便
    clearInterval(this.time);
    delete this;
}
回复

使用道具 举报

 楼主| 发表于 31-12-2004 03:38 PM | 显示全部楼层
感谢中:sp:
如果你是女的.........

还有一个问题是这样的这个贪吃蛇的游戏是我从闪吧那里学的
可是我想要让这游戏能够自动加入难度而不是手动要怎么做呢

Flash: http://img.photobucket.com/albums/v614/emilccp/SHE.swf
回复

使用道具 举报

发表于 31-12-2004 04:40 PM | 显示全部楼层
那么你必须先提供你是如何移动你的贪吃蛇,然后才能够提供你增加速度的方法
回复

使用道具 举报

 楼主| 发表于 31-12-2004 04:46 PM | 显示全部楼层
super-tomato 于 31-12-2004 04:40 PM  说 :
那么你必须先提供你是如何移动你的贪吃蛇,然后才能够提供你增加速度的方法


这里是源文http://rapidshare.de/files-en/259709/189/SHE.fla
回复

使用道具 举报

Follow Us
发表于 31-12-2004 05:00 PM | 显示全部楼层
你的setInterval用法用错了,setInterval只会根据第一次指定的时间执行,之后不会被更动。你可以这样修改



hard = 1; //困难度开始为1
next_level = 10;  //指定每10分升一级


        if(head0._x==egg0._x && head0._y==egg0._y) {//当蛇吃到蛋的处理
                attach_egg=1;
                score+=1;
                _root.attachMovie("snake","head"+score,score);
                mc=eval("head"+score);
                mc._cari_x;
                mc._y=next_y;
                if(int(score/next_level) > hard) {
                        hard++;
                        reload();
                }

        }


function reload() {
        clearInterval(showMove);
        showMove=setInterval(Move,1000/hard);
}
reload();


[ Last edited by super-tomato on 31-12-2004 at 05:06 PM ]
回复

使用道具 举报

 楼主| 发表于 31-12-2004 05:11 PM | 显示全部楼层
哦~回去再试试,2005年还没到就换头像了~谢谢哦
回复

使用道具 举报


ADVERTISEMENT

发表于 1-1-2005 12:19 AM | 显示全部楼层
flash:
http://chinese.cari.com.my/myfor ... =225277&fpage=1


javascript :
http://chinese.cari.com.my/myfor ... =225141&fpage=1

[ Last edited by tensaix2j on 1-1-2005 at 12:21 AM ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 18-10-2024 07:30 PM , Processed in 0.109778 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表