&&&&自己制作flash连连看
自己制作flash连连看
自己制作 好玩 想玩的就下一下 哈哈不错的哦哦
看看下下吧 物超所值
若举报审核通过,可奖励20下载分
被举报人:
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动***等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
VIP下载&&免积分60元/年(1200次)
您可能还需要
课程资源下载排行& & & & 全屏观看地址:& & 视频1地址& & 视频2地址& & 视频3地址& & & & 源文件及 PPT 下载:& & /files/76b3bea8-41d3-11dd-ba6f-b41c/& & & & 代码公布(数字版):& & Card.as:& & package {& & import flash.display.S& & import flash.text.TextF& & import flash.text.TextF& & import flash.filters.*;& & import flash.events.MouseE& & public class Card extends Sprite {& & public var id:& & public var W:Number = 30;& & public var H:Number = 40;& & public var i:& & public var j:& & public var TargetCard:C& & private var color:uint = 0& & public var Path:Array = new Array();& & private var pressed:Boolean =& & & & public var line:Sprite = new Sprite();& & public function Card(id:int) {& & this.id =& & init();& & }& & function init():void {& & graphics.beginFill(color);& & graphics.drawRect(0,0,W,H);& & graphics.endFill();& & var Text:TextField = new TextField();& & Text.text = String(id);& & Text.selectable =& & Text.autoSize = "left";& & var tf:TextFormat = new TextFormat(null,25);& & // tf.size = 25;& & Text.setTextFormat(tf);& & addChild(Text);& & & & addEventListener(MouseEvent.MOUSE_OVER, MouseOver);& & addEventListener(MouseEvent.MOUSE_OUT, MouseOut);& & }& & function setIndex(a:int, b:int):void {& & i =& & j =& & }& & function Pressed():void {& & pressed =& & }& & function UnPressed():void {& & pressed =& & this.filters =& & }& & function MouseOver(evt:MouseEvent):void {& & var blur:BevelFilter = new BevelFilter();& & var shadow:DropShadowFilter = new DropShadowFilter(10);& & var f:Array = new Array();& & f.push(blur);& & f.push(shadow);& & this.filters =& & }& & function MouseOut(evt:MouseEvent):void {& & if (pressed == false) {& & this.filters =& & }& & }& & }& & }& & ============================================& & Main.as& & package {& & import flash.display.S& & import flash.events.MouseE& & import flash.events.E& & public class Main extends Sprite {& & var Row:uint = 4;& & var Colum:uint = 5;& & var MarginLeft:Number = 180;& & var MarginTop:Number = 100;& & var oldCard:C& & var map:A& & public function Main() {& & init();& & }& & & & function init():void {& & map = new Array(Row + 2);& & var numArray:Array = new Array();& & for (var i:uint = 0; i < R i++) {& & numArray[i] = new Array();& & var num:uint = 0;& & for (var j:uint = 0; j < C j++) {& & numArray[i][j] = ++& & }& & }& & for (i = 0; i < R i++) {& & for (j = 0; j < C j++) {& & var Rani:uint = Math.floor(Math.random() * Row);& & var Ranj:uint = Math.floor(Math.random() * Colum);& & var temp:uint = numArray[i][j];& & numArray[i][j] = numArray[Rani][Ranj];& & numArray[Rani][Ranj] =& & }& & }& & for (i = 0; i < Row + 2; i++) {& & map[i] = new Array(Colum + 2);& & for (j = 0; j < Colum + 2; j++) {& & if (i ==0
i == Row + 1
j == Colum + 1) {& & map[i][j] = 0;& & } else {& & map[i][j] = 1;& & }& & }& & }& & & & for (i = 0; i < R i++) {& & for (j = 0; j < C j++) {& & var card:Card = new Card(numArray[i][j]);& & addChild(card);& & card.x = MarginLeft + j * (card.W + 2);& & card.y = MarginTop + i * (card.H + 2);& & card.setIndex(i + 1, j + 1);& & card.addEventListener(MouseEvent.CLICK, onClick);& & }& & }& & }& & function onClick(evt:MouseEvent):void {& & try {& & var currentCard:Card = Card(evt.target.parent);& & } catch (error:Error) {& & currentCard = Card(evt.target);& & }& & if (oldCard == null) {& & oldCard = currentC& & oldCard.Pressed();& & } else {& & oldCard.TargetCard = currentC& & // successfully matched!& & if (isMatched()) {& & addChild(oldCard.line)& & oldCard.line.graphics.clear();& & oldCard.line.graphics.lineStyle(2);& & & & var node:Object = oldCard.Path.shift();& & oldCard.line.graphics.moveTo(MarginLeft + node.y * oldCard.W - oldCard.W / 2, MarginTop + node.x * oldCard.H - oldCard.H / 2);& & & & oldCard.addEventListener(Event.ENTER_FRAME, ToLink);& & oldCard =& & } else {& & // Can not Match!& & oldCard.UnPressed();& & oldCard =& & }& & }& & }& & function ToLink(evt:Event):void {& & var card:Card = Card(evt.target);& & if (card.Path.length > 0) {& & var node:Object = card.Path.shift();& & card.line.graphics.lineTo(MarginLeft + node.y * card.W - card.W / 2, MarginTop + node.x * card.H - card.H / 2);& & } else {& & & & map[card.i][card.j] = 0;& & map[card.TargetCard.i][card.TargetCard.j] = 0;& & card.removeEventListener(Event.ENTER_FRAME, ToLink);& & removeChild(card);& & removeChild(card.line);& & removeChild(card.TargetCard);& & }& & }& & & & function isMatched():Boolean {& & if (oldCard == oldCard.TargetCard
oldCard.id != oldCard.TargetCard.id) {& & & & }& & & & var x1:uint = oldCard.i;& & var y1:uint = oldCard.j;& & var x2:uint = oldCard.TargetCard.i;& & var y2:uint = oldCard.TargetCard.j;& & & & var node:Object = new Object();& & var tempPath:Array = new Array();& & & & for (var i:uint = 0; i < Colum + 2; i++) {& & var count:uint = 0;& & tempPath.splice(0);& & & & var step:int = (y1 > i) ? -1 : 1;& & for (var j = y1; j != j += step) {& & count += map[x1][j];& & node = {x:x1,y:j};& & tempPath.push(node);& & }& & step = (x1 > x2) ? -1 : 1;& & for (j = x1; j != x2; j += step) {& & count += map[j][i];& & node = {x:j,y:i};& & tempPath.push(node);& & }& & step = (i < y2) ? 1 : -1;& & for (j = j != y2; j+= step) {& & count += map[x2][j];& & node = {x:x2,y:j};& & tempPath.push(node);& & }& & if (count == 1) {& & if (oldCard.Path.length == 0
tempPath.length < oldCard.Path.length) {& & oldCard.Path = tempPath.slice();& & }& & }& & }& & for (i = 0; i < Row + 2; i++) {& & count = 0;& & tempPath.splice(0);& & step = (i < x1) ? -1 : 1;& & for (j = x1; j != j += step) {& & count += map[j][y1];& & node = {x:j,y:y1};& & tempPath.push(node);& & }& & step = (y2 > y1) ? 1 : -1;& & for (j = y1; j != y2; j += step) {& & count += map[i][j];& & node = {x:i,y:j};& & tempPath.push(node);& & }& & step = (x2 > i) ? 1 : -1;& & for (j = j != x2; j += step) {& & count += map[j][y2];& & node = {x:j,y:y2};& & tempPath.push(node);& & }& & if (count == 1) {& & if (oldCard.Path.length == 0
tempPath.length < oldCard.Path.length) {& & oldCard.Path = tempPath.slice();& & }& & }& & }& & & & if (oldCard.Path.length > 0) {& & node = {x:x1, y:y1};& & oldCard.Path.unshift(node);& & node = {x:x2, y:y2};& & oldCard.Path.push(node);& & & & }& & & & }& & }& & }& & 详细地址& & .cn/s/blog_3ecb9bwk.html
声明:该文章系网友上传分享,此内容仅代表网友个人经验或观点,不代表本网站立场和观点;若未进行原创声明,则表明该文章系转载自互联网;若该文章内容涉嫌侵权,请及时向
论文写作技巧
上一篇:下一篇:
相关经验教程自己做连连看,自己做连连看小游戏,4399小游戏
分类:&&|&&大小:0.87M&&|&&日期:
请记住本站网址 ,点击,方便下次再玩。
点击开始游戏-选择本地图片上传,剪裁之后上传。可以选择4、6、8张图模式式进行游戏。
游戏加载完毕点击[开始]即可开始游戏
选择你喜欢的图片,做一个独一无二的连连看。
请记住本站网址 ,点击,方便下次再玩。 《自己做连连看》小游戏由4399用户提供。
相关游戏推荐
精彩专题推荐
12345678910
12345678910
文明办网文明上网举报***:&|&举报邮箱:&||
Copyright & 2004 -
All Rights Reserved. 四三九九网络股份有限公司&版权所有