资源简介
matlab做的游戏,里面有4个游戏,分别为,飞飞鸟,特权行动,超级马里奥,星之永叹,带源码,能运行,
代码片段和文件信息
function flappybird
%% System Variables:
GameVer = ‘1.01‘; %
%% Constant Definitions:
GAME.MAX_frame_SKIP = [];
GAME.RESOLUTION = []; % Game Resolution default at [256 144]
GAME.WINDOW_SCALE = 2; % The actual size of the window divided by resolution
GAME.FLOOR_TOP_Y = []; % The y position of upper crust of the floor.
GAME.N_UPDATES_PER_SEC = [];
GAME.frame_DURATION = [];
GAME.GRAVITY = 0.1356; %0.15; %0.2; %1356;
TUBE.MIN_HEIGHT = []; % The minimum height of a tube
TUBE.RANGE_HEIGHT = []; % The range of the height of a tube
TUBE.SUM_HEIGHT = []; % The summed height of the upper and low tube
TUBE.H_SPACE = []; % Horizontal spacing between two tubs
TUBE.V_SPACE = []; % Vertical spacing between two tubs
TUBE.WIDTH = []; % The ‘actual‘ width of the detection box
GAMEPLAY.RIGHT_X_FIRST_TUBE = []; % Xcoord of the right edge of the 1st tube
ShowFPS = true;
SHOWFPS_frameS = 5;
%% Handles
MainFigureHdl = [];
MainAxesHdl = [];
MainCanvasHdl = [];
BirdSpriteHdl = [];
TubeSpriteHdl = [];
BeginInfoHdl = [];
FloorSpriteHdl = [];
ScoreInfoHdl = [];
GameOverHdl = [];
FloorAxesHdl = [];
%% Game Parameters
MainFigureInitPos = [];
MainFigureSize = [];
MainAxesInitPos = []; % The initial position of the axes IN the figure
MainAxesSize = [];
InGameParams.CurrentBkg = 1;
InGameParams.CurrentBird = 1;
Flags.IsGameStarted = true; %
Flags.IsFirstTubeAdded = false; % Has the first tube been added to Tubelayer
Flags.ResetFloorTexture = true; % Result the pointer for the floor texture
Flags.PreGame = true;
Flags.NextTubeReady = true;
CloseReq = false;
FlyKeyNames = {‘space‘ ‘return‘ ‘uparrow‘ ‘w‘};
FlyKeyStatus = false; %(size(FlyKeyNames));
FlyKeyValid = true(size(FlyKeyNames)); %
%% Canvases:
MainCanvas = [];
% The scroll layer for the tubes
Tubelayer.Alpha = [];
Tubelayer.CData = [];
%% RESOURCES:
Sprites = [];
%% Positions:
Bird.COLLIDE_MASK = [];
Bird.INIT_SCREEN_POS = [45 100]; % In [x y] order;
Bird.WorldX = [];
Bird.ScreenPos = [45 100]; %[45 100]; % Center = The 9th element horizontally (1based)
% And the 6th element vertically
Bird.SpeedXY = [ 0];
Bird.Angle = 0;
Bird.XGRID = [];
Bird.YGRID = [];
Bird.Curframe = 1;
Bird.SpeedY = 0;
Bird.LastHeight = 0;
SinYRange = 44;
SinYPos = [];
SinY = [];
Score = 0;
Tubes.FrontP = 1; % 1-3
Tubes.ScreenX = [300 380 460]-2; % The middle of each tube
Tubes.VOffset = ceil(rand(13)*105);
Best = 0;
%% -- Game Logic --
initVariables();
initWindow();
if ShowFPS
fps_text_handle = text(1010 ‘FPS:60.0‘ ‘Visible‘ ‘off‘);
var_text_handle = text(1020 ‘‘ ‘Visible‘ ‘off‘); % Display a variable
total_frame_update = 0;
end
% Show flash screen
CurrentframeNo = double(0);
fade_time = cumsum([1 3 1]);
pause(0.5);
logo_stl = text(72 10
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-06-13 18:21 matlab游戏\
目录 0 2014-06-13 18:21 matlab游戏\flappybird\
文件 69423 2014-03-12 15:20 matlab游戏\flappybird\Flappy Bird.mlappinstall
文件 20459 2014-03-12 15:20 matlab游戏\flappybird\flappybird.m
文件 129750 2014-06-13 17:09 matlab游戏\flappybird\flappybird.zip
文件 22321 2014-03-12 15:20 matlab游戏\flappybird\Snapshot.png
文件 36469 2014-06-13 17:25 matlab游戏\flappybird\sprites2.mat
文件 2201 2014-06-13 17:31 matlab游戏\flappybird\说明.txt
目录 0 2014-06-13 18:21 matlab游戏\opeig3d\
文件 45316 2013-07-18 18:02 matlab游戏\opeig3d\opeig.m
文件 1434227 2014-06-13 17:30 matlab游戏\opeig3d\opeig3d.zip
文件 537 2013-07-18 18:15 matlab游戏\opeig3d\OPEIG_WAD.mat
文件 781114 2013-07-18 18:15 matlab游戏\opeig3d\OPEIG_WALLS.mat
文件 719492 2013-07-18 18:27 matlab游戏\opeig3d\Operation Eigenfaust 3D Demo.mlappinstall
文件 1157 2013-07-18 17:56 matlab游戏\opeig3d\Readme.txt
文件 27081 2013-07-18 18:21 matlab游戏\opeig3d\Snapshot2.png
文件 1321 2014-06-13 17:38 matlab游戏\opeig3d\说明.txt
目录 0 2014-06-13 18:21 matlab游戏\SuperMarioBrosDemo\
文件 1117 2013-03-24 01:30 matlab游戏\SuperMarioBrosDemo\ITS-A-READ-ME.MARIO.txt
文件 914 2013-03-24 01:30 matlab游戏\SuperMarioBrosDemo\MarioData.mat
文件 1711 2013-03-24 01:30 matlab游戏\SuperMarioBrosDemo\mario_stages.mat
文件 59198 2013-03-24 01:30 matlab游戏\SuperMarioBrosDemo\stl_mario_main.m
文件 24239 2013-03-24 01:30 matlab游戏\SuperMarioBrosDemo\Super Mario Bros. Demo.mlappinstall
文件 39367 2014-06-13 18:13 matlab游戏\SuperMarioBrosDemo\SuperMarioBrosDemo.zip
文件 1314 2014-06-13 18:17 matlab游戏\SuperMarioBrosDemo\说明.txt
目录 0 2014-06-13 18:21 matlab游戏\星之永叹\
目录 0 2014-06-13 18:21 matlab游戏\星之永叹\Stellaria Demo App 1.4.0\
文件 714325 2012-09-25 00:07 matlab游戏\星之永叹\Stellaria Demo App 1.4.0\Stellaria Demo 1.4.0.mlappinstall
文件 711087 2014-06-13 17:58 matlab游戏\星之永叹\Stellaria Demo App 1.4.0\Stellaria Demo App 1.4.0.rar
目录 0 2014-06-13 18:21 matlab游戏\星之永叹\StellariaTechDemoB20120924\
目录 0 2014-06-13 18:21 matlab游戏\星之永叹\StellariaTechDemoB20120924\StellariaTechDemoB20120910\
............此处省略97个文件信息
相关资源
-
matlab之simuli
nk最通俗教程 -
Matlab_Simuli
nk与控制系统仿真 PDF - 现代通信系统_使用MATLAB (刘树棠译)
- 雷达系统分析与设计应用 MATLAB
-
详解MATLABSimuli
nk通信系统建模与仿真 - MPC_MATLAB_Book.pdf
- 数字信号处理实验报告内含matlab源代
- 阵列信号处理算法MATLAB常用程序
- 先进PID控制MATLAB仿真第3版完整仿真程
- PID控制MATLAB仿真第2版含MATLAB源代码
- bp神经网络 matlab代码 识别0到10的数字
- MATLAB教程详细讲解
- 全景图像拼接代码MATLAB版本
- MATLAB 程序 实现图像拼接,自动匹配特
- surf的matlab算法实现
- 忆阻器 Matlab 源代码 附带用户手册
- MATLAB神经网络应用设计
- 多份OFDM仿真的MATLAB仿真代码,以及相
- MATLAB智能算法-温正-配书代码
- 多机器人路径规划-matlab
- 多幅图像拼接matlab实现
- matlab计算峰值旁瓣比和积分旁瓣比
- 空间三自由度机械臂MATLAB仿真模型
- 模型预测控制MPC程序
- MATLAB工具箱大全,各种算法
- MATLAB下人脸图像的PCA重构
- 人脸表情识别matlab代码
- 雷达回波信号建模与仿真研究
- matlab图像粗糙度计算
- ransac 的详细介绍以及matlabtoolbox的使用
评论
共有 条评论