Game Development with Unity and C#
description
Transcript of Game Development with Unity and C#
Stronger. Together. One Microsoft
By Shahed ChowdhuriSenior Technical Evangelist
Game Development with Unity and C#
Windows Web Xbox Mobile@shahedC
WakeUpAndCode.comTitle Page: Game Development with Unity and C#Windows Web Xbox Mobile
By Shahed ChowdhuriTechnical Evangelist
Blog: WakeUpAndCode.comTwitter: @shahedC
2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.6/11/20141Events & ContestsBAM! Best App a Month for June 2014
URL: http://aka.ms/BAMWashDC(select Windows 8 for platform!)URL: http://tinyurl.com/msdcmeetup
Events & ContestsBAM! Contest: http://aka.ms/BAMWashDC VA Tech Hackathon: http://vthacks.com
2AgendaAgendaIntro + XNA/XBLIG> Construct2> C++ and DirectX> Unity with C#Being an Indie in the Real World
* Learn about how you can build games for Windows, Web and Xbox platforms. * Visual tools like Construct 2, programming with C++ and DirectX, and using your C# experience with Unity.* Not a deep dive into each topic, but enough info for you to get started and pick a direction.
3My BackgroundPeriodBackground/Experience1997 presentMicrosoft web/software development2011XNA games on XBLIG2D Math PanicAngry Zombie Ninja Cats2012Tools for XNA developersXBLIG Sales Data Analyzer (OnekSoftLabs.com)XNA Basic Starter Kit (CodePlex)
Online: http://facebook.com/OnekSoftGames My Background1997 present: Microsoft web/software development2011: XNA games on XBLIG2D Math PanicAngry Zombie Ninja Cats2012: Tools for XNA developersXBLIG Sales Data Analyzer (OnekSoftLabs.com)XNA Basic Starter Kit (CodePlex) Online: http://facebook.com/OnekSoftGames
4My Background (continued)PeriodBackground/Experience2013Ninja Cat Runner on Win8, WP8, Web (Construct2)Video Q&A with MS Tech Evangelist Frank La VigneFounder/Admin of FB groups: Construct2, Xbox One & Unity Indie DevsAttended ID@Seattle, Microsofts first ID@Xbox summit2014Public Speaking on Indie Game DevelopmentJoined Microsoft as a Technical EvangelistAttended ID@ChicagoWorking with Kinect v2
Video: http://youtu.be/lRjrQPvVOpo My Background (continued)2013Ninja Cat Runner on Windows 8 (Construct2)Video Q&A with MS Tech Evangelist Frank La VigneFounder/Admin of Xbox One Indie Devs Group (FB)Attended ID@Seattle, Microsofts ID@Xbox summit2014Public Speaking on Indie Game DevelopmentJoined Microsoft as a Technical EvangelistVideo: http://youtu.be/lRjrQPvVOpo
5Official Xbox Magazine
Source: Official Xbox Magazine, March 2014, Page 65
`Official Xbox Magazine, March 2014, Page 65"Shahed Chowdhuri's got a day job already, but in his spare time he crafts XBLIG games and tools for his fellow developers.With a math game and a pair of platformers under his belt, it's his XBLIG Sales Data Analyzer and XNA Basic Starter Kit that has his peers championing him."
6Tools & Technologies
Tools & TechnologiesVisual Studio 2013Windows 8Microsoft .NET and Visual C#Xbox OneConstruct2C++ and DirectX 11.1+HTML5/CSS/JSUnityPaint.netBlender7
Unity: Things to Know
Learning curveCreate/Import modelsDownload/purchase modelsAsset StorePublish virtually anywhere!
Unity: Things to KnowLearning curve for beginnersNeed to create your own modelsOr download/purchase pre-built modelsPublish to Web, mobile, desktop, consoles
8Agenda
AgendaIntro + XNA/XBLIG> Construct2> C++ and DirectX> Unity with C#Being an Indie in the Real World
* Learn about how you can build games for Windows, Web and Xbox platforms. * Visual tools like Construct 2, programming with C++ and DirectX, and using your C# experience with Unity.* Not a deep dive into each topic, but enough info for you to get started and pick a direction.
9UI Basics & Assets
Creating a New 2D Project
Click File New ProjectSelect an empty folderSelect 2D in the dropdownClick the Create buttonEditor Settings for 2D
Click Edit Project Settings EditorVerify 2D Mode is the defaultUnity UI: Scene, Hierarchy & Project Assets
Unity UI: Animation and Game Panels2D OverviewCollider 2D & Physics 2D (instead of Collider & Physics)Sprite Renderer, Sorting LayersGame Objects and Scripting!Mecanim for sprite sheets
2D is just 3D in orthographic viewCustomizing Your Editor UIHierarchyProjectScene ViewGame ViewConsoleAnimatorAnimationInspectorLayers
Importing a Sprite
Drag into the sceneNote: Create Prefabs to reuse instances of an object in your scene.http://docs.unity3d.com/Manual/Prefabs.html Textures and Sprites
Each texture can have spritesSet the position/rotation/scale in the InspectorBackground Import Settings
Sorting Layers
Lock Layers
Add Layers via Sprite RendererMoving Around
Sprite EditorAdding Components
Adding a Sprite Renderer
Adding a New Script (C#/JS/Boo)
Start() and Update() in your Script
Built-in Input Controls
Updating Objects via transform.position
Running Your Game
Scripts & Animations
Animation ClipsCreate New Clip, Curves, KeyframesAdding Sprites From a Sprite Sheet
Drag sprites as a group or individuallyAdding Curves Manually
Change values manually for each keyframeCreate multiple animations, view one at a timeLoop Time for Animations
Transitions, Colliders & Triggers
Animator Tab
Create transition from between animationsRight-click a state to Make TransitionAdd parameters and set valuesConditions
Click a transition to edit in InspectorSet Conditions for selected TransitionLinking Events to Keyframes
Right-click a keyframe to add animation eventOr select keyframe, and click []+ iconSelect function from your code, set parameters
`Custom Colliders
Use OnTriggerEnter2D and OnTriggerExit2D in codeEnabling Triggers in 2D Colliders
Swapping Colliders at Runtime
Called from Keyframe eventsUse a script to control positioning behaviorUsing Empty Objects as Spawn Points
Updating Gravity Settings
Set Y to 0 (zero) for top-down 2D gamesAgenda
AgendaIntro + XNA/XBLIG> Construct2> C++ and DirectX> Unity with C#Being an Indie in the Real World
* Learn about how you can build games for Windows, Web and Xbox platforms. * Visual tools like Construct 2, programming with C++ and DirectX, and using your C# experience with Unity.* Not a deep dive into each topic, but enough info for you to get started and pick a direction.
44Graphics For Your Game
CommercialAdobe IllustratorAdobe PhotoshopFREE!GimpPaint.netAudio ToolsFL Studio: http://www.image-line.com/flstudio/ Free demo, buy to access all features
Audacity: http://audacity.sourceforge.net/ Free, open-source
Useful LinksThis presentationhttp://WakeUpAndCode.com/downloads
Zombie Conga Tutorial, by Chris LaPollohttp://www.raywenderlich.com/61532/unity-2d-tutorial-getting-started
Unity Tutorials: http://unity3d.com/learn
Free Assets: http://codefoster.com/media
For More Info:Xbox One Indie Devs:http://facebook.com/groups/XboxOneIndieDevshttp://WakeUpAndCode.com/xb1
Unity Indie Devs:http://facebook.com/groups/UnityIndieDevs http://WakeUpAndCode.com/unity
For more info:Xbox One Indie Devs:http://facebook.com/groups/XboxOneIndieDevshttp://WakeUpAndCode.com/xb1
Unity Indie Devs:http://facebook.com/groups/UnityIndieDevs http://WakeUpAndCode.com/unity
Construct2 Devs:https://www.facebook.com/groups/construct2devs
48Mecanim for 2D Sprite Animations
https://github.com/Banbury/UnitySpritesAndBones/wiki/Tutorial%3A-Using-Sprites-And-Bones-and-Mecanim-to-animate-a-bird2D Platformer Overviewhttp://blogs.unity3d.com/2013/11/12/unity-4-3-2d-game-development-overview/ https://www.youtube.com/watch?v=4qE8cuHI93c
Official Unity 5 Feature Preview Trailer (jump to 2:10 for 2D)https://www.youtube.com/watch?v=dk8gpz0o5TU
Unity 5 PreviewAgenda
AgendaIntro + XNA/XBLIG> Construct2> C++ and DirectX> Unity with C#Being an Indie in the Real World
* Learn about how you can build games for Windows, Web and Xbox platforms. * Visual tools like Construct 2, programming with C++ and DirectX, and using your C# experience with Unity.* Not a deep dive into each topic, but enough info for you to get started and pick a direction.
52
ContactEmail: [email protected] Twitter: @shahedC Contact
Web: OnekSoft.comEmail: [email protected]: @OnekSoftGames
Microsoft email: [email protected] Twitter: @shahedC
R&D: OnekSoftLabs.comDev Blog: WakeUpAndCode.com FB: http://facebook.com/groups/XboxOneIndieDevs
53