Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use Matlab to make gold miner Mini Game

Shulou Source: shulou.com Published: 2022-06-01 10:38:36 10月01日 Update

In this article, the editor introduces in detail "how to use Matlab to make gold miner Mini Game". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use Matlab to make gold miner Mini Game" can help you solve your doubts.

Effect.

Step by step picture preparation

The pictures used in this article are here.

Background to construct function goldMinerMainfig=figure ('units','pixels','position', [50 100 750 500], 'Numbertitle','off','menubar','none','resize','off',... 'name','goldMiner'); axes (' parent',Mainfig,'position', [0 011],... 'XLim', [0750],... 'YLim', [0500],... 'NextPlot','add',... 'layer','bottom',... 'Visible','on',... 'YDir','reverse',... 'XTick', [],... 'YTick', []); bkgPic=imread ('.\ pic\ bkg.png'); image ([0750], [0500], bkgPic) [manPic,~,manAlp] = imread ('.\ pic\ man.png'); image ([400-60400: 60], [49.5-45, 49.5: 45], manPic,'AlphaData',manAlp)

Draw claws

Because the claw needs to constantly adjust the angle, so it is drawn in surface format, we need to adjust the range of the claw image matrix to [0Power1] and change the transparent value to nan.

[clawPic,~,clawAlp] = imread ('.\ Pic\ claw.png'); clawPic=double (clawPic). / 255; clawPicG=clawPic (:,: 1); clawPicG=clawPic (:,:, 2); clawPicB=clawPic (:,:, 3); clawPicR (clawAlp

Tags: Claws Mini Game miners gold production pictures articles stones code content steps matrix stone angle speed movement adjustment proper that is ideas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Xiaomi MariaDB vpn Docker