Unformatted text preview:

Computer)Science)–)Game)Design)UC)Santa)Cruz)CMPS 20: Game Design Experience Imagine)Cup)Team)Forma9on)XNA)Input)January)14,)2010)Arnav)Jhala)Adapted)from)Jim)Whitehead’s)slides)Computer)Science)–)Game)Design)UC)Santa)Cruz)Announcements)• Team)Forma9on)(Details)are)on)the)website))– Team)member)names)and)bio)– Contact)Informa9on)– Means)of)communica9on)– Loca9on)of)mee9ngs)• Once)teams)are)formed)I)will)randomly)assign)more)members)in)teams)of)<4)students)(combine)two)2)person)teams))• This)informa9on)must)be)submiSed,)typewriSen,)on)a)piece)of)paper.)AUer)submission)of)this)assignment,)each)team)member)will)be)expected)to)know)this)informa9on,)so)you)should)take)this)opportunity)to)add)phone)numbers)to)cell)phones,)email)addresses)to)email)applica9ons,)etc.)• Details)of)sec9ons)are)now)on)the)webpage)• Link)to)Moodle)class)page)is)now)on)the)main)class)homepage)• Email)TA)David)Seagal)or)me)for)Moodle)related)issues)Computer)Science)–)Game)Design)UC)Santa)Cruz)Kenny)Spade:)Imagine)Cup)Computer)Science)–)Game)Design)UC)Santa)Cruz)Upcoming)Project)Deliverable)• Game)Concept)Document)– A)compelling)document)that)sells)your)game)concept)– Title)page)• Title)of)game,)name)of)group,)name)of)team)members,)sample)artwork)– Overview)page)• Table)at)top:)game)genre,)pla]orm)(PC/XBox),)team)size)• Key)points)sec9on)– Bulleted)list)of)important)elements)of)gameplay)– Goal)of)game,)what)makes)game)unique,)main)characters,)main)fic9onal)elements)– Sample)artwork)image)to)give)feel)of)the)game)– Biographies)• True,)pocket)biographies)of)each)team)member)(1‐2)paragraphs)each))stressing)experience)that)makes)you)a)strong)game)designer)– 1‐3)pages)giving)a)textual)descrip9on)of)the)game)• Fic9onal)background,)brief)descrip9on)of)characters,)goal)of)player)in)game,)how)does)player)interact)with)the)game,)brief)descrip9on)of)levels,)game)audience,)other)important)elements)as)needed.)– 1‐2)pages)of)sample)conceptual)artwork)• Hand‐drawn)sketches)are)fine)• See)template)and)evalua9on)criteria)on)course)website)Computer)Science)–)Game)Design)UC)Santa)Cruz)Game)Input)• XNA)Framework)supports)three)input)sources)– Xbox)360)controller)• Wired)controller)under)Windows)• Wireless)or)wired)for)Xbox)360)• Up)to)4)at)a)9me)– Keyboard)• Good)default)for)Windows)games)• Xbox)360)also)supports)USB))keyboards)– Mouse)• Windows)only)(no)Xbox)360)support))• Poll)for)input)– Every)clock)9ck,)check)the)state)of)your)input)devices)– Generally)works)OK)for)1/60th)second)9cks)Computer)Science)–)Game)Design)UC)Santa)Cruz)Digital)vs)Analog)Controls)• Input)devices)have)two)types)of)controls)• Digital'– Reports)only)two)states:)on)or)off'– Keyboard:)keys)– Controller)A,)B,)X,)Y,)Back,)Start,)D‐Pad)• Analog)– Report)a)range'of'values'– XBox)360)controller:)‐1.0f)to)1.0f)– Mouse:)mouse)cursor)values)(in)pixels))Computer)Science)–)Game)Design)UC)Santa)Cruz)Input)Type)Overview)Input Device Digital Buttons Analog Controls Vibration Win? Xbox? Number Xbox 360 Controller 14 4 Yes Yes (wired or wireless with adapter) Yes (wireless or wired) 4 Keyboard >100 0 No Yes Yes 1 Mouse 5 3 No Yes No 1Computer)Science)–)Game)Design)UC)Santa)Cruz)Xbox)360)Controller)Input)• Every)clock)9ck)– Get)state)of)controller)• Call)GetState())on)GamePad)class)• Pass)in)PlayerIndex)– PlayerIndex.One,)PlayerIndex.Two,)…)– Corresponds)to)lit)region)in)“ring)of)light”)• Returns)a)GamePadState)structure)– Check)if)controller)is)connected)• IsConnected)boolean)in)GamePadState)– Check)GamePadState)for)current)state)of)digital)and)analog)inputs)– Recall)that)update())is)called)every)clock)9ck)• Get)input)in)update(),)or)a)method)called)from)it)Computer)Science)–)Game)Design)UC)Santa)Cruz)GamePad)Class)• A)sta2c)class)– Do)not)need)to)create)an)instance)to)use)– All)methods)are)sta9c)• GetState)– Retrieve)current)state)of)all)inputs)on)one)controller)• SetVibra9on)– Use)to)make)controller)vibrate)• GetCapabili9es)– Determine)which)input)types)are)supported.))– Can)check)for)voice)support,)and)whether)controller)is)connected.)public static class GamePad { public static GamePadCapabilities GetCapabilities(PlayerIndex playerIndex); public static GamePadState GetState(PlayerIndex playerIndex); public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode); public static bool SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor); }Computer)Science)–)Game)Design)UC)Santa)Cruz)C#)Structs)• A)struct)in)C#)is)a)lightweight)alterna9ve)to)a)class)• Similar)to)class)– Can)have)constructors,)proper9es,)methods,)fields,)operators,)nested)types,)indexers)• Different)from)class)– Struct)does)not)support)inheritance,)or)destructors)– Is)a)value)type)(classes)are)reference)types))• Rule)of)thumb:)– Use)structs)for)types)that)are)small,)simple,)similar)in)behavior)to)built‐in)types)Computer)Science)–)Game)Design)UC)Santa)Cruz)GamePadState)Struct)• Proper9es)for)reading)state)of)the)GamePad)– Digital)Input:)BuSons,)DPad)– Analog)Input:)ThumbS9cks,)Triggers)– Check)connec9on)state:)IsConneced)– PacketNumber)• Number)increases)when)gamepad)state)changes)• Use)to)check)if)player)has)changed)gamepad)state)since)last)9ck)public struct GamePadState { public static bool operator !=(GamePadState left, GamePadState right); public static bool operator ==(GamePadState left, GamePadState right); public GamePadButtons Buttons { get; } public GamePadDPad DPad { get; } public bool IsConnected { get; } public int PacketNumber { get; } public GamePadThumbSticks ThumbSticks { get; } public GamePadTriggers Triggers { get; } }Computer)Science)–)Game)Design)UC)Santa)Cruz)GamePadBuSons)Struct)(BuSons))• Proper9es)for)retrieving)current)buSon)state)– A,)B,)X,)Y)– Start,)Back)– LeUS9ck,)RightS9ck)• When)you)press)straight)down)on)each)joys9ck,)is)a)buSon)press)– LeUShoulder,)RightShoulder)• Possible)values)are)given)by)BuSonState)enumera9on)– Released)–)buSon)is)up)–


View Full Document

UCSC CMPS 20 - Lecture Notes

Documents in this Course
Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?