feat: 星域故事汇小游戏初始版本

This commit is contained in:
2026-03-03 16:57:49 +08:00
commit cc0e39cccc
34 changed files with 6556 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/**
* 微信小游戏适配器
*/
// 获取系统信息
const systemInfo = wx.getSystemInfoSync();
const screenWidth = systemInfo.windowWidth;
const screenHeight = systemInfo.windowHeight;
const devicePixelRatio = systemInfo.pixelRatio;
// 创建主Canvas
const canvas = wx.createCanvas();
canvas.width = screenWidth * devicePixelRatio;
canvas.height = screenHeight * devicePixelRatio;
// 设置全局变量
GameGlobal.canvas = canvas;
GameGlobal.screenWidth = screenWidth;
GameGlobal.screenHeight = screenHeight;
GameGlobal.devicePixelRatio = devicePixelRatio;
// Image适配
GameGlobal.Image = function() {
return wx.createImage();
};
// Audio适配
GameGlobal.Audio = function() {
return wx.createInnerAudioContext();
};
export default {
canvas,
screenWidth,
screenHeight,
devicePixelRatio
};