Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Latest commit

 

History

History
116 lines (70 loc) · 5.72 KB

index.md

File metadata and controls

116 lines (70 loc) · 5.72 KB
title description ms.prod ms.assetid ms.date
CocosSharp 2D Game Engine
This document links to various articles about game development with CocosSharp. Linked content describes sample apps, drawing, animation, and more.
xamarin
5E72869D-3541-408B-AB64-D34C777AFB79
03/29/2018

CocosSharp 2D Game Engine

CocosSharp is a library for building 2D games using C# and F#. It is a .NET port of the popular Cocos2D engine.

Introduction to CocosSharp

The CocosSharp 2D game engine provides technology for making cross-platform games. For a full list of supported platforms see the CocosSharp wiki on GitHub. These guides use C# for code samples, although CocosSharp is fully functional with F# as well.

The core of CocosSharp is provided by the MonoGame framework, which is itself a cross-platform, hardware accelerated API providing graphics, audio, game state management, input, and a content pipeline for importing assets. CocosSharp is an efficient abstraction layer well suited for 2D games. Furthermore, larger games can perform their own optimizations outside of their core libraries as games grows in complexity. In other words, CocosSharp provides a mix of ease of use and performance, enabling developers to get started quickly without limiting game size or complexity.

This hands-on video shows how to create a simple cross-platform CocosSharp game:

[!Video https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Developing-Cross-platform-2D-Games-in-C-and-CocosSharp/player]

BouncingGame

This guide describes BouncingGame, including how to work with game content, the various visual elements used to build a game, adding game logic, and more.

Fruity Falls game screenshot

This guide describes the Fruity Falls game, covering common CocosSharp and game development concepts such as physics, content management, game state, and game design.

Coin Time game screenshot

Coin Time is a full platformer game for iOS and Android. The goal of the game is to collect all of the coins in a level and then reach the exit door while avoiding enemies and obstacles.

Shapes drawn with CCDrawNode

CCDrawNode provides methods for drawing primitive objects such as lines, circles, and triangles.

A CCAction animation

CCAction is a base class that can be used to animate CocosSharp objects. This guide covers built-in CCAction implementations for common tasks such as positioning, scaling, and rotating. It also looks at how to create custom implementations by inheriting from CCAction.

A level in a game

Tiled is a powerful, flexible, and mature application for creating orthogonal and isometric tile maps for games. CocosSharp provides built-in integration for Tiled’s native file format.

A spaceship from a game

The entity pattern is a powerful way to organize game code. It improves readability, makes code easier to maintain, and leverages built-in parent/child functionality.

A grid representing screen resolution

This guide shows how to work with CocosSharp to develop games that display properly on devices of varying resolutions.

XNB

Content pipelines are often used in game development to optimize content and format it such that it can be loaded on certain hardware or with certain game development frameworks.

A tree from a CCSpriteSheet

CCSpriteSheet provides functionality for combining and using many image files in one texture. Reducing texture count can improve a game’s load times and framerate.

A representation of how CocosSharp caches images

CocosSharp’s CCTextureCache class provides a standard way to organize, cache, and unload content.

An image being rotated

This guide covers 2D mathematics for game development. It uses CocosSharp to show how to perform common game development tasks and explains the math behind these tasks.

A sprite from a game

The CCRenderTexture class provides functionality for rendering multiple CocosSharp objects to a single texture. Once created, CCRenderTexture instances can be used to render graphics efficiently and to implement visual effects.