[英]Spacefield with Jquery
i want to program a 2D-sqare Gamefield. 我想编写一个2D正方形的Gamefield。 The gamefield shall consits of 9 subfields.
游戏场由9个子场组成。 The Gamefield shall be an Image , like an Spacefield or so.
Gamefield应该是一个Image ,例如Spacefield左右。 Here you can see the concept, and how it shall later look like (just a mockup :P)
在这里您可以看到概念,以及以后的外观(只是一个模型:P)
Within this field i want to move a Object from one field to the other (vertical /horizontal) . 在此字段中,我想将一个对象从一个字段移动到另一个字段(垂直/水平)。 But i don't know how i can realize that.
但是我不知道我怎么能意识到这一点。 I had think of an multidimensional array, but i don't know if this is the right way to do this.
我曾想过一个多维数组,但是我不知道这是否是正确的方法。 I need to know, at which pixel in the image the new field begins.
我需要知道,新字段从图像的哪个像素开始。 But i think its no good idea to code that hard.
但是我认为很难编写代码并不是一个好主意。 I want to do this with Jquery, CSS and HTML.
我想用Jquery,CSS和HTML做到这一点。 It shall become a very simple online game.
它将成为一个非常简单的在线游戏。
Qapla' Qapla”
In game development these fields are usually called tiles. 在游戏开发中,这些领域通常称为图块。
It's perfectly fine to create a multidimensional array of Tile
s. 创建
Tile
的多维数组非常好。 Whether they hold their own position or if it's up to a separate renderer is up to your design. 是否保留自己的位置,还是由单独的渲染器决定,取决于您的设计。
Some links you might be interested in: 您可能对某些链接感兴趣:
Canvas
-element) Canvas
-element) Canvas
) Canvas
时不那么有用) I'd recommend reading up on Tiles in game development first, there are tons of example implementations. 我建议先阅读游戏开发中的Tiles,这里有大量示例实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.