HTML小游戏27 - Chuck Chicken 魔法蛋网页游戏(附完整源码)

  • 💂 网站推荐:【神级源码资源网】【摸鱼小游戏】 【工具大全
  • 🤟 基于Web端打造的:👉【轻量化工具创作平台】
  • 💅 想寻找共同学习交流、摸鱼划水的小伙伴,请点击【学习交流群】

本节教程我会带大家使用 HTML 、CSS和 JS 来制作一个 Chuck Chicken 魔法蛋网页游戏

✨ 前言


🕹️ 本文已收录于🎖️100个HTML小游戏专栏:100个H5游戏专栏icon-default.png?t=N7T8https://blog.csdn.net/qq_53544522/category_12064846.html
🎮 目前已有100+小游戏,源码在持续更新中,前100位订阅限时优惠,先到先得。
🐬 订阅专栏后可阅读100个HTML小游戏文章;还可私聊进前端/游戏制作学习交流群;领取一百个小游戏源码。

在线演示地址:摸鱼小游戏 | Chuck Chicken 魔法蛋 | 海拥游戏 | Chuck Chicken 魔法蛋;立志打造一个拥有100个小游戏的摸鱼网站。made by Haiyong,技术支持——海拥icon-default.png?t=N7T8https://haiyong.site/moyu/magicegg/
源码也可在文末进行获取


✨ 项目基本结构


大致目录结构如下(共278个子文件):

场景展示

HTML源码

<body onload="setTimeout(function(){window.scrollTo(0,1)},1);">
    <div id="ajaxbar">
        <div id="game"><canvas id="canvas"></canvas></div>
        <div id="orientate"><img src="media/graphics/orientate/landscape.jpg" /></div>
        <div id="play" class="play" onclick=""><img src="media/graphics/splash/mobile/cover-start.jpg" /></div>
    </div>
</body>

CSS 源码

html,body 

html,
body {
	background-color: #000;
	margin: 0;
	padding: 0;
	position: relative;
	font-family: "Arial";
	width: 100%;
}

#game

#game {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 0;
}

#ajaxbar

#ajaxbar {
	background: url('media/graphics/loading/ajax-loader.gif') center no-repeat;
}

#canvas

#canvas {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	-ms-interpolation-mode: nearest-neighbor;
	-webkit-transform: scale3d(1, 1, 1);
	z-index: 1;
}

#orientate

#orientate {
	position: absolute;
	float: left;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	z-index: 10002;
	display: none;
}

JS 源码

js 代码较多,这里提供部分,完整源码可以在文末下载

var _SETTINGS

var _SETTINGS = {
	API: {
		Enabled: !1,
		Log: {
			Events: {
				InitializeGame: !0,
				EndGame: !0,
				Level: {
					Begin: !0,
					End: !0,
					Win: !0,
					Lose: !0,
					Draw: !0
				}
			}
		}
	},
	Ad: {
		Mobile: {
			Preroll: {
				Enabled: !1,
				Duration: 5,
				Width: 300,
				Height: 250,
				Rotation: {
					Enabled: !1,
					Weight: {
						MobileAdInGamePreroll: 40,
						MobileAdInGamePreroll2: 40,
						MobileAdInGamePreroll3: 20
					}
				}
			},
			Header: {
				Enabled: !1,
				Duration: 5,
				Width: 320,
				Height: 50,
				Rotation: {
					Enabled: !1,
					Weight: {
						MobileAdInGameHeader: 40,
						MobileAdInGameHeader2: 40,
						MobileAdInGameHeader3: 20
					}
				}
			},
			Footer: {
				Enabled: !1,
				Duration: 5,
				Width: 320,
				Height: 50,
				Rotation: {
					Enabled: !1,
					Weight: {
						MobileAdInGameFooter: 40,
						MobileAdInGameFooter2: 40,
						MobileAdInGameFooter3: 20
					}
				}
			},
			End: {
				Enabled: !1,
				Duration: 1,
				Width: 300,
				Height: 250,
				Rotation: {
					Enabled: !1,
					Weight: {
						MobileAdInGameEnd: 40,
						MobileAdInGameEnd2: 40,
						MobileAdInGameEnd3: 20
					}
				}
			}
		}
	},
	Language: {
		Default: "en"
	},
	DeveloperBranding: {
		Splash: {
			Enabled: !1
		},
		Logo: {
			Enabled: !1,
			Link: "http://google.com",
			LinkEnabled: !1,
			NewWindow: !0,
			Width: 166,
			Height: 61
		}
	},
	Branding: {
		Splash: {
			Enabled: !1
		},
		Logo: {
			Enabled: !1,
			Link: "http://google.com",
			LinkEnabled: !1,
			NewWindow: !0,
			Width: 166,
			Height: 61
		}
	},
	MoreGames: {
		Enabled: !1,
		Link: "http://www.marketjs.com/game/links/mobile",
		NewWindow: !0
	}
};

var _STRINGS

var _STRINGS = {
	Ad: {
		Mobile: {
			Preroll: {
				ReadyIn: "The game is ready in ",
				Loading: "Your game is loading...",
				Close: "Close"
			},
			Header: {
				ReadyIn: "The game is ready in ",
				Loading: "Your game is loading...",
				Close: "Close"
			},
			End: {
				ReadyIn: "Advertisement ends in ",
				Loading: "Please wait ...",
				Close: "Close"
			}
		}
	},
	Splash: {
		Loading: "Loading ...",
		LogoLine1: "Some text here",
		LogoLine2: "powered by MarketJS",
		LogoLine3: "none",
		TapToStart: "TAP TO START"
	},
	VO: {
		chuckStart: "Let's get started;After you taste my fist;I have to find his weak point;This is your last chance to surrender;What's going on?;We gotta stop this!;Time for real action;Oh no you don't;I'll take care of this".split(";"),
		chuckStartMayor: ["How much is the reward for saving the city this time?", "Right away, Mr Mayor!", "Okay, it's a deal!"],
		chuckStartSweetheart: ["Stay calm sweetheart, Chuck is on his way!"],
		chuckWin: ["Nice warm up", "This must be my lucky day", "It's all in a day's work!"],
		mingoStart: ["I won't fail this time", "Nothing can stop me now!"],
		deeStart: ["Von voyage!", "Ha ha ha ha ha ha ha ha ha ha ha ha ha!", "We're going to live like kings!"],
		dexStart: ["Yahoo!", "Ha ha ha ha ha ha ha ha!", "Dex the super Duck!"],
		donStart: ["Yahoo!", "Ha ha ha ha ha ha ha ha ha ha ha ha ha!"],
		birdyStart: ["Let's rock!"],
		ninjaStart: ["I'm getting promoted!", "We're at your command!"],
		sinisterStart: ["I summon you my shadow army, serve your master!"],
		ronnieStart: ["Ronnie and Gino, reporting for duty, sir!"],
		ginoStart: ["Ronnie and Gino, reporting for duty, sir!"],
		penStart: ["If you move one step forward, I'll make you a frozen chicken"],
		guinStart: ["If you move one step forward, I'll make you a frozen chicken"],
		mayorStart: ["Chuck, go get him!"],
		mulanStart: ["Help!"],
		flickStart: ["Chuck, help!", "Chuck, it's me, Flick!"],
		wingStart: ["Chuck, help!"],
		hypotizedStart: ["Your wish is my command"],
		rainbowStart: ["Help me!"],
		coupleStart: ["Help me!"]
	},
	Shop: [{
		Name: "Guide",
		Info: "Egg guide line",
		Price: 24
	}, {
		Name: "Extra Egg",
		Info: "1 extra egg",
		Price: 24
	}, {
		Name: "Extra Bounce",
		Info: "1 extra bounce",
		Price: 24
	}, {
		Name: "Magic Egg Respawn",
		Info: "Respawn after used",
		Price: 24
	}],
	Chuck: {
		rhino: {
			name: "Rhinoceros Punch",
			skill: "Punch to defeat hard to reach enemies"
		},
		eagle: {
			name: "Eagle Eyes",
			skill: "Fly to save hanging hostages"
		},
		skunk: {
			name: "Stinky Skunk",
			skill: "Make nearby enemies faint with stinky skunk spray"
		},
		mole: {
			name: "Spinning Mole",
			skill: "Drill to open locked cages"
		},
		cheetah: {
			name: "Speeding Cheetah",
			skill: "Run to heat up frozen hostages"
		},
		spider: {
			name: "Spider Feet",
			skill: "Stick on wall to throw egg"
		},
		fish: {
			name: "Leaping Toadfish",
			skill: "Swim pass the water pool"
		},
		armadillo: {
			name: "Armadillo Shield",
			skill: "Destroy machines with its hard shell"
		},
		bat: {
			name: "Bat Power",
			skill: "Detect cannon ball and throw eggs past them"
		},
		snake: {
			name: "Rubber Snake",
			skill: "Stretch elastic hand to reach enemies"
		},
		rat: {
			name: "Miniscule Mouse",
			skill: "Shrink to pass through small holes to toggle lever"
		},
		chameleon: {
			name: "Invisible Chameleon",
			skill: "Turn invisible to avoid laser detection"
		},
		unlock: {
			name: "Awesome Stunt!",
			skill: "New chapters unlocked!"
		}
	},
	Tutorial: {
		"continue": {
			desktop: "Click to continue",
			mobile: "Tap to continue"
		},
		shoot: {
			desktop: "Aim and click to shoot Golden Egg",
			mobile: "Aim and tap to shoot Golden Egg"
		},
		magicEgg: "Shoot the Golden Egg towards \nthe Magic Egg to transform Chuck.",
		lever: "Shoot the lever with Golden Egg \nto open the metal door with the\nsame colour",
		retry: "Press E to restart level",
		pool: "Shoot towards the Toadfish Egg\nat the angle of the Pool Portal",
		laser: "Transform into Invisible \nChameleon to switch \noff laser",
		hang: "Transform into Eagle Eye\nto save hanging hostages",
		doll: "Defeat Cuddly birdy\nto revert the doll\nhostage",
		blackhole: "A blackhole teleports Golden\nEgg to another blackhole",
		robot: "Robots can only be destroyed\nby defeating Dr Mingo holding\nthe controller",
		tank: "Tanks can only be destroyed\nby defeating Dr Mingo holding\nthe controller",
		hypotized: "Hypnotized hostages can\nonly be saved by defeating\nDee holding the controller",
		cage: "Shoot the Spinning Mole\nEgg towards the direction \nof the Cage to destroy it",
		frozen: "Shoot the Speeding Cheetah\nEgg towards the direction of\nthe hostage to rescue it",
		machine: "Shoot the Armadillo Shield\nEgg towards the direction \nof the machine to destroy it"
	},
	Game: {
		SelectPlayer: "Select Player",
		Win: "You win!",
		Lose: "You lose!",
		Score: "Score",
		Time: "Time",
		Buy: "BUY",
		Owned: "OWNED",
		Unlock: "Complete chapter 1 and 2 to unlock this chapter",
		Locked: "LOCKED",
		E: "E",
		Level: "LEVEL ",
		Shop: "SHOP",
		Theme: "CHAPTERS",
		Levels: "LEVELS",
		Paused: "SETTINGS",
		Settings: "SETTINGS",
		Gallery: "GALLERY",
		Over: "Game Over",
		Win: "YOU WIN",
		Lose: "YOU LOSE"
	},
	Results: {
		Title: "High score"
	}
};

图片资源

 


一共一百多多张图片,全都打包放在文末的下载链接里了。

音频资源

源码下载

1.CSDN资源下载:https://download.csdn.net/download/qq_44273429/88991938icon-default.png?t=N7T8https://download.csdn.net/download/qq_44273429/88991938

2.从海拥资源网下载:Chuck Chicken 魔法蛋网页游戏源码_海拥资源库Chuck Chicken 魔法蛋网页游戏源码_海拥资源库icon-default.png?t=N7T8https://code.haiyong.site/994/
3.也可通过下方卡片添加好友回复 Chuck Chicken 获取

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/479266.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

技术分享|揭秘第三代指标平台如何解决复杂指标的定义与计算问题

本文根据 Aloudata 直播专栏 “NoETL 公开课&#xff5c;第三代指标平台如何解决复杂指标的定义与计算问题&#xff1f;”的演讲内容整理发布。 讲师简介&#xff1a;张乐&#xff0c;Aloudata CAN 指标平台技术负责人。8 年互联网技术架构和数据平台产品相关经验&#xff0c;…

预约陪诊服务app开发的运营模式分析详解

一、引言 随着社会的发展和人们生活水平的提高&#xff0c;人们对健康的需求越来越高&#xff0c;预约陪诊服务应运而生。预约陪诊服务app作为一种便捷的就医工具&#xff0c;为患者提供了更加人性化的就医体验。本文将对预约陪诊服务app开发的运营模式进行分析&#xff0c;以期…

鸿蒙Harmony应用开发—ArkTS(@BuilderParam装饰器:引用@Builder函数)

当开发者创建了自定义组件&#xff0c;并想对该组件添加特定功能时&#xff0c;例如在自定义组件中添加一个点击跳转操作。若直接在组件内嵌入事件方法&#xff0c;将会导致所有引入该自定义组件的地方均增加了该功能。为解决此问题&#xff0c;ArkUI引入了BuilderParam装饰器&…

多ip多进程代理的实现方法

目录 写在前面 一、背景 二、实现方法 1. 使用多线程处理代理请求 2. 使用多进程处理代理请求 3. 实现多IP代理 三、总结 写在前面 实现多IP多进程代理需要使用Python的多线程和多进程模块。本文将介绍如何使用这些模块来实现多IP多进程代理&#xff0c;并提供相关的代…

基于SSM+Jsp+Mysql的高校二手交易平台

基于SSMJspMysql的高校二手交易平台 基于SSMJspMysql的高校二手交易平台的设计与实现 开发语言&#xff1a;Java框架&#xff1a;ssm技术&#xff1a;JSPJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff0…

API 接口渗透测试

1 API 接口介绍 1.1 RPC&#xff08;远程过程调用&#xff09; 远程过程调用&#xff08;英语&#xff1a;Remote Procedure Call&#xff0c;缩写为 RPC&#xff09;是一个计算机通信协议。该协议允许运行于一台计算机的程序调用另一台计算机的子程序&#xff0c;而程序员无…

一个案例,看懂AI Agent厂商的商业落地路径

随着大语言模型技术的日益成熟&#xff0c;国内科技巨头纷纷加快在AI Agent领域的布局和应用落地。凭借自身强大的技术积累和丰富的应用场景&#xff0c;推动AI Agent技术在各行各业的深度融合与创新应用。 在AI Agent的落地应用上&#xff0c;目前科技巨头正借助已有AI技术平…

CSDN个人简介优化 html font属性

CSDN个人简介优化 html font属性 个人简介个人简介优化字体21种样式选择字体大小设置4号字体 字体颜色设计渐变色&#xff08;可惜不能显示&#xff09; 字体加粗设置 <b>标签 个人简介 &#x1f308;你好呀&#xff01;我是 是Yu欸 &#x1f30c; 2024每日百字篆刻时光…

spring cloud项目微服务间互相调用使用自定义标注进行鉴权方案

来吧&#xff0c;贴代码。 一、背景 我们有一个项目使用了spring cloud&#xff0c;有的微服务需要调用别的微服务&#xff0c;但这些调用没有鉴权&#xff1b;当初项目时间非常紧&#xff0c;同时这部分微服务有的对外也没有鉴权&#xff0c;在代码中设置了无须鉴权&#xf…

三连杆滑块机构运动学仿真 | 【Matlab源码+理论公式文本】|曲柄滑块 | 曲柄连杆 | 机械连杆

【程序简介】&#x1f4bb;&#x1f50d; 本程序通过matlab实现了三连杆滑块机构的运动学仿真编程&#xff0c;动态展现了三连杆机构的运动动画&#xff0c;同时给出了角位移、角速度和角加速度的时程曲线&#xff0c;除了程序本身&#xff0c;还提供了机构运动学公式推导文档…

【MySQL】MySQL用户管理

文章目录 一、用户1.用户信息2.创建用户3.删除用户4.修改用户密码 二、数据库的权限1.给用户授权2.回收权限 一、用户 如果我们只能使用root用户&#xff0c;这样存在安全隐患。这时&#xff0c;就需要使用MySQL的用户管理。 1.用户信息 我们安装mysql之后&#xff0c;会自动…

ATFX汇市:预期之外,瑞士央行率先降息!瑞郎对美元剧烈贬值

ATFX汇市&#xff1a;昨日&#xff0c;全球的交易者都在盯着美联储和英国央行的利率决议&#xff0c;期待在鲍威尔和贝利的讲话中窥见未来的利率路径。然而&#xff0c;被大部分人所忽略的瑞士央行&#xff0c;在昨日16:30的利率决议上&#xff0c;宣布降息25基点&#xff0c;将…

类对象的初始化过程与方法

类初始化过程与方法 一、类对象的初始化过程 1.初始化的过程 &#xff08;1&#xff09;对象在实例化的时候需要调用构造函数&#xff0c;如果对应的构造函数调用不了&#xff0c;这个对象是没有办法实例化的。 &#xff08;2&#xff09;构造函数的执行&#xff0c;是在内…

2024腾龙杯web签到题-初识jwt(签到:这是一个登录页面)

什么是 jwt? 它是 JSON Web Token 的缩写&#xff0c;是一个开放标准&#xff0c;定义了一种紧凑的、自包含的方式&#xff0c;用于作为JSON对象在各方之间安全地传输信息&#xff0c;该信息可以被验证和信任&#xff0c;因为它是数字签名的。它就是一种认证机制&#xff0c;…

接口自动化之操作mysql数据库!

在接口自动化测试过程中并不像UI自动化测试一样存在界面可以通过界面数据校验正确性&#xff0c;除了可以通过接口返回的数据校验还可以通过操作数据库校验数据&#xff0c;那么我们该如何做接口自动化的数据校验呢&#xff1f;这篇文章我们就讲解以mysql为例&#xff0c;讲解接…

项目系统使用异步业务流程(线程池详细实现)

❤ 作者主页&#xff1a;李奕赫揍小邰的博客 ❀ 个人介绍&#xff1a;大家好&#xff0c;我是李奕赫&#xff01;(&#xffe3;▽&#xffe3;)~* &#x1f34a; 记得点赞、收藏、评论⭐️⭐️⭐️ &#x1f4e3; 认真学习!!!&#x1f389;&#x1f389; 文章目录 异步化1.介绍…

雷卯有高强Ipp的多种电压ESD保护器件推荐

1.上海雷卯推出多种电压 高强Ipp ESD 防护器件 下表仅是部分展示。 3.USB PD 防浪涌方案 4.为什么需要高强Ipp ESD防护器件 硬件工程师常会遇到这种情况&#xff0c;我的PCB 板上电源也放ESD保护器件 了&#xff0c;但是当插拔电或上电瞬间ESD保护器件烧毁了&#xff0c;导致…

schweizer-electronic 公司 safedat2 操作使用说明

schweizer-electronic 公司 safedat2 操作使用说明

从上到下,深入理解LIN协议 及 进阶问题

目录 一、当LIN总线静默4s-10s时&#xff0c;节点自动进入休眠状态。这个“自动进入休眠状态”是怎么实现的&#xff1f;二、帧的架构设计2.1 问题提出2.2 帧设计 三、帧超时功能四、主节点如何接收从节点上报的数据&#xff1f;五、网络管理5.1 当功能开关关闭时&#xff0c;应…

乐得瑞科技PD协议芯片:OTG与充电并行,引领数据交互

在科技日新月异的今天&#xff0c;数据交互的方式对于我们的日常生活和工作都起到了至关重要的作用。但在OTG技术诞生之前&#xff0c;这一过程却显得相当繁琐和耗时。想象一下&#xff0c;你需要将数码相机的照片导入到笔记本电脑中&#xff0c;却不得不频繁地拔出内存卡&…