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

news2024/11/14 14:49:50
  • 💂 网站推荐:【神级源码资源网】【摸鱼小游戏】 【工具大全
  • 🤟 基于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 获取

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Kafka系列】Kafka事务一般在什么场景下使用呢

面试官&#xff1a;听说你精通Kafka&#xff0c;那我就考考你吧 面试官&#xff1a;不用慌尽管说&#xff0c;错了也没关系&#x1f60a;。。。 以【面试官面试】的形式来分享技术&#xff0c;本期是《Kafka系列》&#xff0c;感兴趣就关注我吧❤️ 面试官&#xff1a;生产者重…

G1和ZGC垃圾回收器学习

前言 ​ 随着JDK17的占有率不断升高和SpringBoot3最低支持JDk17&#xff0c;JDK17很大概率会成为大家后续升级的一个选择&#xff0c;而JDK17上最重要的垃圾回收器G1和ZGC&#xff0c;也就显得格外重要。大家提前了解或者学习一下肯定是有用的。 ​ 本篇文章也默认大家了解一…

【linux】进程地址空间(进程三)

目录 快速了解&#xff1a;引入最基本的理解&#xff1a;细节&#xff1a;如何理解地址空间&#xff1a;a.什么是划分区域&#xff1a;b.地址空间的理解&#xff1a; 为什么要有进程空间&#xff1f;进一步理解页表与写时拷贝&#xff1a; 快速了解&#xff1a; 先来看这样一段…

docker入门(九)—— docker网络详细介绍

docker 网络 准备工作&#xff1a;清空所有镜像和容器 docker rm -f $(docker ps -aq) docker rmi -f $(docker images -aq)docker0 网络 查看本地网络 ip addr[rootiZbp15293q8kgzhur7n6kvZ /]# ip addr# 本地回环网络 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc…

jmeter接口导入方式

curl直接导入 1、操作页面后&#xff0c;F12查看接口&#xff0c;右击接口-copy-copy as cURL 2、jmeter 工具-import from cURL&#xff0c;粘贴上面复制的curl 根据接口文档导入 1、接口文档示例如下&#xff1a; Path&#xff1a; /api/jobs/xps/exec Method&#xf…

3d画线生成模型之后最大化找不到---模大狮模型网

当你在3D建模软件中画线生成模型后&#xff0c;如果最大化找不到该模型&#xff0c;可能是因为以下几种情况导致&#xff1a; 模型位置偏移&#xff1a; 可能你在绘制线条时&#xff0c;将模型画在了视图界面之外&#xff0c;导致最大化时无法看到。尝试平移或旋转模型&#x…

东方博宜 1449. 求满足条件的数的和

东方博宜 1449. 求满足条件的数的和 这道题我苦想了很久&#xff0c;觉得2个及2个以上很难解决&#xff0c;但是后面发现&#xff0c;可以用一个变量记录次数&#xff0c;次数大于等于2就好了。 #include<iostream> using namespace std; int main() {int n ;cin >…

企业用大模型如何更具「效价比」?百度智能云发布5款大模型新品

服务8万企业用户&#xff0c;累计帮助用户精调1.3万个大模型&#xff0c;帮助用户开发出16万个大模型应用&#xff0c;自2023年12月以来百度智能云千帆大模型平台API日调用量环比增长97%...从一年前国内大模型平台的“开路先锋”到如今的大模型“超级工厂”&#xff0c;百度智能…

革新水库大坝监测:传统软件与云平台之比较

在水库大坝的监测管理领域&#xff0c;传统监测软件虽然曾发挥了重要作用&#xff0c;但在多方面显示出了其局限性。传统解决方案通常伴随着高昂的运维成本&#xff0c;需要大量的硬件支持和人员维护&#xff0c;且软件整合和升级困难&#xff0c;限制了其灵活性和扩展性。 点击…

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

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

好看的表情壁纸

不定时更新表情壁纸&#xff0c;后期支持头像&#xff0c;wx背景等&#xff0c;个人开发&#xff0c;觉得不错&#xff0c;可前往小程序或者公众号查看

深入理解模板进阶:掌握C++模板的高级技巧

&#x1f389;个人名片&#xff1a; &#x1f43c;作者简介&#xff1a;一名乐于分享在学习道路上收获的大二在校生 &#x1f648;个人主页&#x1f389;&#xff1a;GOTXX &#x1f43c;个人WeChat&#xff1a;ILXOXVJE &#x1f43c;本文由GOTXX原创&#xff0c;首发CSDN&…

基于springboot的员工绩效考核管理系统(含源文件)

&#xff08;源码附文章底部&#xff09; 摘 要 科学时代的发展改变了人类的生活&#xff0c;促使网络与计算机技术深入人类的各个角落&#xff0c;得以普及到人类的具体生活中&#xff0c;为人类的时代文明掀开新的篇章。本系统为月度员工绩效考核管理系统&#xff0c;是专为…

JAVA入门第一步2.0

一、JAVA中的关键字 Java中的关键字是Java编程语言中预先定义并保留的单词&#xff0c;它们具有特殊的含义&#xff0c;不能用作变量名、方法名或类名等标识符。以下是我查到的Java中的一些主要关键字&#xff1a; 由于我还在入门&#xff0c;所以所接触的关键字不多&#xf…

从0到1实现RPC | 02 RpcConsumer的远程调用

一、RPC的简化版原理如下图&#xff08;核心是代理机制&#xff09;。 1.本地代理存根: Stub 2.本地序列化反序列化 3.网络通信 4.远程序列化反序列化 5.远程服务存根: Skeleton 6.调用实际业务服务 7.原路返回服务结果 8.返回给本地调用方 二、新建一个模块rpc-demo-c…

如何真正改变自己? 《掌控习惯》

维持改变 1.心态 目标与体系&#xff0c;谁是真正通往成功的钥匙&#xff1f; 2.行动 习惯转变的3个层次 身份 你要成为谁&#xff1f; 你为成为他而幸福吗&#xff1f;过程结果 习惯的基本原理&#xff1a;要重视微小的改变 维持改变成两个方面入手 一、心态&#xff1a;忽略…

【算法刷题】Day33

文章目录 1. 最长湍流子数组题干&#xff1a;算法原理&#xff1a;1. 状态表示&#xff1a;2. 状态转移方程3. 初始化4. 填表顺序5. 返回值 代码&#xff1a; 2. 最长递增子序列题干&#xff1a;算法原理&#xff1a;1. 状态表示&#xff1a;2. 状态转移方程3. 初始化4. 填表顺…

详解rtklib中main函数如何配置文件

目录 Step1&#xff1a;如何给rtklib中的主函数 rnx2rtkp 传参 Step2&#xff1a;给配置选项结构体赋默认值 Step3&#xff1a;继续配置 Step4&#xff1a;寻找 main 函数参数中的 -k Step5&#xff1a;依次遍历参数 Step1&#xff1a;如何给rtklib中的主函数 rnx2rtkp 传参…

SpringBoot接口防止重复提交(AOP+Redis)

方法一&#xff1a; 若依框架的实现 【具体靠请求地址URL参数列表来判断请求是否重复】 SpingBoot接口防止重复提交_springboot接口防抖(防重复提交)的一些实现方案-CSDN博客文章浏览阅读518次。3.根据缓存键获取缓存中对象&#xff0c;如果存在&#xff0c;判断当前请求参…

156.乐理基础-和弦固定标记法(五)挂留(sus)和弦省略音(omit)和弦

如果到这五线谱还没记住还不认识的话去看102.五线谱-高音谱号与103.五线谱-低音谱号这两个里&#xff0c;这里面有五线谱对应的音名&#xff0c;对比着看 如果一章没落下&#xff0c;看到这里&#xff0c;但是看不懂什么意思&#xff0c;那就强行下看&#xff0c;看着看着指不…