情人节浪漫3D照片墙【附源码】_图片墙 源码,整理出这份8万字大数据开发性能优化实战解析

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新大数据全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip204888 (备注大数据)
img

正文

debugPanel: debugPanel
});
engine.add(debugPanel);

debugPanel.set({hello: “Word”});
// Draws this on screen
// {“fps”: 58, “ct”: 7, “hello”: “World”}

debugPanel.set({hello: “Dolly”});
// {“fps”: 58, “ct”: 7, “hello”: “Dolly”}

debugPanel.unset(“hello”);
// {“fps”: 58, “ct”: 7}


In the above example, the debug panel is created. It is added to the engine as a model to draw. It is also passed as an option to the engine so it can output fps and ct (cycle time).



We manually add attribute hello to be tracked. Whenever it changes, so does the print out on screen. Use unset to remove a tracked attribute.


Conditional Usage


It is recommended that you support the non-existence of the debug panel with an if (this.debugPanel) statement before setting. For example, when you extend a class, pass in the debug panel as an option. Then, in your code, check to see if it exists. For example, this is done in the Backbone.Engine.draw method:


if (this.debugPanel) this.debugPanel.set({fps: this.fps, ct: this.cycleTime});


This supports the case where the debug panel is never created (debugPanel = undefined), such as in production.



  <div id="documentation-Shapes" class="row">
    <div class="col-md-12">
      <h3>Shape functions</h3>
      <p>
        File <code>shapes.js</code> contains helper functions to draw elementary shapes in the 2d drawing context of a canvas. You are free to use direct methods on the context to draw. These are provided as convenience. The functions are added to the global scope, under <code>window</code>. Supported functions are:
      </p>
      <pre>

drawRect(ctx, x, y, width, height, fill, stroke)
drawCircle(ctx, x, y, radius, fill, stroke)
drawRoundRect(ctx, x, y, width, height, radius, fill, stroke)


I encourage you to add your own. If you do, respect these recommendations:



  • Functions take as first argument ctx the drawing context.

  • Second and third arguments should be x and y coordinates.

  • Last arguments should be fill the fill style, and stroke the stroke style. They should be optional if possible.



  <div id="mobile-devices" class="row">
    <div class="col-md-12">
      <h1>Mobile Devices</h1>
      <p>
        Backbone Game Engine was built for mobile first.
      </p>
      <h3>Touch Events</h3>
      <p>
        <a href="#documentation-Engine">Backbone.Engine</a>, <a href="#documentation-Input">Backbone.Input</a>, <a href="#documentation-Button">Backbone.Button</a> and <a href="#documentation-WorldEditor">Backbone.WorldEditor</a> support touch and mouse events transparently. Works on Android, iOS and Windows.
      </p>
      <h3>Viewport resizing and canvas centering</h3>
      <p>
        On mobile devices, the <code>meta</code> tag <code>viewport</code> is set to 960 pixels wide.
        On iOS, Android and Windows mobile devices, this will ensure the canvas is full width.
        The HTML file contains the necessary header tags to ensure everything works.
        You can change the viewport width value to whatever you want.
      </p>
<meta name="viewport" content="width=960, user-scalable=no"/>
<meta name="mobileoptimized" content="0" />
      <p>
        Not all screens have the same aspec ratio.
        To take care of the height, you can change the height of the canvas upon start by calling the global function <code>adjustViewport()</code> (see file <code>adjust-viewport.js</code> for details).
      </p>
var canvas = document.getElementById("foreground");
adjustViewport(canvas);
      <p>
        If you want to maintain the aspect ratio, pass true. The canvas will be centered on screen.
      </p>
var canvas = document.getElementById("foreground");
adjustViewport(canvas, true);
    <p>
      On desktop the <code>viewport</code> meta tag is ignored.
      <code>adjustViewport</code> will center the canvas, even handling resizes.
      It will try to reduce the height of the canvas if too tall unless you omit the <code>keepRatio</code> argument.
    </p>
    <h3>Web App</h3>
    <p>
      These meta tags are set to enable Web App support:
    </p>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <p>
      To suggest users to put add the home page to the home screen, checkout this great plugin:
      <a href="https://github.com/cubiq/add-to-homescreen" target="\_blank">Cubiq's Add To Homescreen</a>.

Going Offline

With HTML Application Cache, you can go offline with your game. Super Mario Bros level 1-1 uses the application cache. The first time your browser loads that page, it will save the web page, along with all assets in its application cache. Subsequent visits will load these from the application cache instead of the server.

Note: Application Cache only works when loaded from a server. It will not if you have forked the repo, and are loading the file from your disk ( file:///). That's good because under development, we want to load the new code every refresh.

If you have Google Chrome, open the console and you will see this:

Creating Application Cache with manifest http://martindrapeau.github.io/backbone-game-engine/super-mario-bros/offline.appcache
Application Cache Checking event martindrapeau.github.io/:1
Application Cache Downloading event martindrapeau.github.io/:1
Application Cache Progress event (0 of 23) http://martindrapeau.github.io/backbone-game-engine/3rd/qtree.js
Application Cache Progress event (1 of 23) http://martindrapeau.github.io/backbone-game-engine/src/input.js
...
Application Cache Progress event (22 of 23) http://martindrapeau.github.io/backbone-game-engine/super-mario-bros/super-mario-enemies-2x.png
Application Cache Progress event (23 of 23)
Application Cache Cached event 

Subsequent times, you will see this:

Document was loaded from Application Cache with manifest http://martindrapeau.github.io/backbone-game-engine/super-mario-bros/offline.appcache
Application Cache Checking event
Application Cache NoUpdate event

Manifest File

Using an Application Cache is dead simple. First you must add the manifest attribute to your HTML tag. It points to the manifest file:

<!doctype html>
<html manifest="offline.appcache">
    <head>
Second, create the manifest file. It contains files that must be cached. For example here is the offline.appcache:
CACHE MANIFEST
# Version 0.11 (c) 2014-2015 Martin Drapeau

…/3rd/qtree.js
…/3rd/underscore.js
…/3rd/backbone.native.js
…/3rd/backbone.js

…/src/input.js
…/src/shapes.js
…/src/core.js
…/src/world.js
…/src/local-storage.js
…/src/camera.js
…/src/editor.js
…/src/hero.js

mario.js
tiles.js
artifacts.js
enemies.js
display.js
level_1-1.js
main.js

super-mario-2x.png
super-mario-tiles-2x.png
super-mario-enemies-2x.png
icons.png


If you have server requests, you can add a NETWORK section. Consult the docs for details.



Fianally, the comment with Version 0.11 is important. When a new version of Super Mario Bros level 1-1 is released, the version number is increased to force the browser to reload the files. It will also trigger an updateready event which gets captured to show a download button. That informs the user a new version is ready to be downloaded. Clicking on that button simply refreshes the browser to reload the new version.



  <div id="persistence" class="row">
    <div class="col-md-12">
      <h1>Persistence</h1>
      <p>
        Backbone offers RESTful persistence via <a href="http://backbonejs.org/#Sync" target="\_blank">Backbone.sync</a>. Models have methods <code>fetch</code> and <code>save</code> to retrieve/send the model/collection JSONified data to/from the server. As such, you can easily implement server-side persistence using well established RESTful standards.
      </p>
      <p>
        In our Super Mario Bros example, we use <a href="https://developer.apple.com/library/safari/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Name-ValueStorage/Name-ValueStorage.html" target="\_blank">local storage</a> instead. This is done by overriding <code>Backbone.World</code> methods <code>save</code> and <code>fetch</code>. See file <code>src/local-storage.js</code> for details.
      </p>
    </div>
  </div>

  <div id="performance" class="row">
    <div class="col-md-12">
      <h1>Performance and Debugging</h1>

        <li><a href="http://blog.artillery.com/2012/10/browser-garbage-collection-and-framerate.html" target="\_blank">Browser Garbage Collection and Frame Rate</a></li>
        <li><a href="https://www.scirra.com/blog/76/how-to-write-low-garbage-real-time-javascript" target="\_blank">How to write low garbage real-time Javascript</a></li>
        <li><a href="http://www.html5rocks.com/en/tutorials/canvas/performance/" target="\_blank">Improving HTML5 Canvas Performance</a></li>
      </ul>
    </div>
  </div>

  <div id="publishing" class="row">
    <div class="col-md-12">
      <h1>Publishing your Game</h1>
      <h2>On the Web</h2>
      <p>
        If you forked this repo, your game is already published on the web on your Github page under <code>[username].github.io/backbone-game-engine</code>.
      </p>
  <div id="change-log" class="row">
    <div class="col-md-12">
      <h1>Change Log</h1>
      <h4>0.40 - TBD</h4>
      <ul>
        <li>Upcoming release to include bug fixes, improvements and new features to come following the release to iOS of Ludo's Quest.</li>
      </ul>
      <h4>0.30 - 2015-03-22</h4>
      <ul>
        <li>Backbone.Element - a rudimentary DOM element with image, text and animations.</li>
        <li>Backbone.World now uses a QuadTree for collision detection.</li>
        <li>Removed dependence on hammer.js. Backbone.Engine now triggers tap and key events.</li>
        <li>Complete rewrite of Backbone.Input. Removed its pause button.</li>
        <li>Complete rewrite of Backbone.Character.</li>
        <li>Complete rewrite of Backbone.Hero.</li>
        <li>Backbone.Editor now resizes sprites to fit in the specified tileWidth and tileHeight.</li>
        <li>Rewrite of adjustViewport global function to work cross-device.</li>
        <li>Official support of CocoonJS canvas+.</li>
      </ul>
      <h4>0.21 - 2015-02-06</h4>
      <ul>
        <li>Sprite padding</li>
        <li>More efficient gamepad drawing</li>
        <li>Editor: paging, shrink large sprites, highlight tiles</li>
        <li>World: z-index, tap event,key event, fixed background image, improved sprite lookup, bug fixes</li>
      </ul>
      <h4>0.20 - 2014-12-31</h4>
      <p>
        Major improvements including:
        <ul>
          <li>Performance improvements.</li>
          <li>Fast sprite lookup.</li>
          <li>Faster dynamic and static drawing.</li>
          <li>Efficient collision detection.</li>
          <li>Character and hero knockout and dying.</li>
          <li>Bug fixes.</li>
        </ul>
      </p>
      <h4>0.11 - 2014-11-12</h4>
      <p>
        Adjust viewport on orientation change, and center canvas.
      </p>
      <h4>0.10 - 2014-05-19</h4>
      <p>
        Initial release.
      </p>
    </div>
  </div>

</div>

<div class="col-md-3">
  <div id="sidebar" class="bs-sidebar affix">
    <ul class="nav bs-sidenav">
      <li class="active"><a href="#introduction">Introduction</a></li>
      <li><a href="#getting-started">Getting Started</a></li>
      <li><a href="#documentation">Reference</a></li>
      <li><a href="#documentation-Engine">&nbsp;&nbsp;Backbone.Engine</a></li>
      <li><a href="#documentation-SpriteSheet">&nbsp;&nbsp;Backbone.SpriteSheet</a></li>
      <li><a href="#documentation-SpriteSheetCollection">&nbsp;&nbsp;Backbone.SpriteSheetCollection</a></li>
      <li><a href="#documentation-Sprite">&nbsp;&nbsp;Backbone.Sprite</a></li>
      <li><a href="#documentation-Input">&nbsp;&nbsp;Backbone.Input</a></li>
      <li><a href="#documentation-World">&nbsp;&nbsp;Backbone.World</a></li>
      <li><a href="#documentation-WorldEditor">&nbsp;&nbsp;Backbone.WorldEditor</a></li>
      <li><a href="#documentation-Character">&nbsp;&nbsp;Backbone.Character</a></li>
      <li><a href="#documentation-Hero">&nbsp;&nbsp;Backbone.Hero</a></li>
      <li><a href="#documentation-Camera">&nbsp;&nbsp;Backbone.Camera</a></li>
      <li><a href="#documentation-Clock">&nbsp;&nbsp;Backbone.Clock</a></li>
      <li><a href="#documentation-Element">&nbsp;&nbsp;Backbone.Element</a></li>
      <li><a href="#documentation-Button">&nbsp;&nbsp;Backbone.Button</a></li>
      <li><a href="#documentation-DebugPanel">&nbsp;&nbsp;Backbone.DebugPanel</a></li>
      <li><a href="#documentation-Shapes">&nbsp;&nbsp;Shape functions</a></li>
      <li><a href="#mobile-devices">Mobile Devices</a></li>
      <li><a href="#going-offline">Going Offline</a></li>
      <li><a href="#persistence">Persistence</a></li>
      <li><a href="#performance">Performance</a></li>
      <li><a href="#publishing">Publishing</a></li>
      <li><a href="#change-log">Change Log</a></li>
    </ul>
  </div>
</div>

</div>
</div>
<br/>

<footer class="navbar navbar-default">
    <p class="navbar-text navbar-left">
      &copy; 2014 <a href="http://martindrapeau.tumblr.com/">Martin Drapeau.</a>
      <a href="https://github.com/martindrapeau/backbone-game-engine/blob/gh-pages/LICENSE">Licensed under MIT.</a>
    </p>
    <p class="navbar-text navbar-right">Written in Montréal, Canada.</p>
    <p class="navbar-text navbar-right">&nbsp;</p>
</footer>

![在这里插入图片描述](https://img-blog.csdnimg.cn/99cadad4c30b4517a6b3369b1cb4d8a9.png)


#### 源码下载


获取源码,公众号回复【情人节浪漫3D照片墙】,即可。更多最新Java面试题加群、见群公告。~


不会还有人没 **点赞 + 关注 + 收藏** 吧!


![在这里插入图片描述](https://img-blog.csdnimg.cn/8c6f8a8833e64963a72596002f628fb8.png)


### 系列推荐:


[Java 实现 捕鱼达人 小游戏【附源码】]( )


[Java 实现 贪吃蛇 小游戏【附源码】]( )


[Java 实现 1024 小游戏【附源码】]( )


[Java实现一个坦克大战的小游戏【附源码】]( )


[Java实现一个打飞机的小游戏【附源码】]( )


[Java 实现 植物大战僵尸 小游戏【附源码】]( )


[制作温馨浪漫爱心表白动画特效HTML5+jQuery【附源码】]( )


[基于SpringBoot+Bootstrap【爱码个人博客系统】附源码]( )


[基于SSM【爱校图书馆管理系统】附源码+论文]( )


[情人节浪漫3D照片墙【附源码】]( )


[…]( )


### [查看更多博主首页更多实战项目 >>>]( )


**项目源码获取方法**




**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)**
![img](https://img-blog.csdnimg.cn/img_convert/b5ba0cd907770acdc6db2b7b32a35ab2.png)

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

p【爱码个人博客系统】附源码]( )


[基于SSM【爱校图书馆管理系统】附源码+论文]( )


[情人节浪漫3D照片墙【附源码】]( )


[…]( )


### [查看更多博主首页更多实战项目 >>>]( )


**项目源码获取方法**




**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)**
[外链图片转存中...(img-URQYA4FK-1713404069968)]

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值