Font Size: a A A

Design And Implementation Of The Real Time Strategy Game Based On HTML5

Posted on:2015-07-27Degree:MasterType:Thesis
Country:ChinaCandidate:Y C YangFull Text:PDF
GTID:2308330473451747Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With this development of the HTML5 Technology, the Web Technology becomes more and more powerful that it can be using to do more things.The Web Technology is mainly used in building website before while more and more developers use the HTML5 to develop games with the advent of the Canvas and WebGL Technology.This thesis abstracts a 2D game engine and develops a real time strategy game which contains production, construction, resource acquisition, combat, map fog and other RTS elements.To the 2D game engine, this thesis mainly realizes the frames of the core classes,animation, event management, resource loading and puts forward the tool and UI modules. The core classes realize the main loop, scene, sprite and other components,provide the hoop methods to the user that it enhances the engine’s scalability. With the combination of the animation frame and the Texturepacker tool, users can directly use the animation frame data created by the tool to generate the sprite animation in the three ways provided by the animation frame. The event management frame supports the monitoring and management of the mouse and keyboard events. The resource loading frame supports images and JSON files, and provides a resource management class to schedule unified.To the game, this thesis focuses on the research of several aspects of the map scrolling, sprite occlusion, sprite moves and combat. In the realization of map scrolling,this thesis references and expands the realization of map scrolling in 2D games and applys it to this 2.5D game to realize parallel scrolling in the map edge. The sprite occlusion for 2.5D games is a difficult problem, this thesis puts forward the zOrder attribute and the method of sorting the sprites with their occlusion order to solve it.Sprite moves for real-time strategy game is also a big problem, this thesis uses the algorithms of the A Star and collision steering to solve the static and dynamic routing problems.In the development of the battle function, this thesis proposes the concepts of the attack point and attacked point, realizes the ranged and melee attack.
Keywords/Search Tags:2D engine, real-time strategy game, HTML5, RTS
PDF Full Text Request
Related items