Presentation is loading. Please wait.

Presentation is loading. Please wait.

Display 480x800 QVGA 320x480 HVGA Capacitive touch 4 or more contact points Camera 5 mega pixels or more Dedicated camera button Hardware buttons.

Similar presentations


Presentation on theme: "Display 480x800 QVGA 320x480 HVGA Capacitive touch 4 or more contact points Camera 5 mega pixels or more Dedicated camera button Hardware buttons."— Presentation transcript:

1

2

3

4

5

6 Display 480x800 QVGA 320x480 HVGA Capacitive touch 4 or more contact points Camera 5 mega pixels or more Dedicated camera button Hardware buttons Start, Search, Back Sensors A-GPS, Accelerometer, Compass GPU DirectX 9 acceleration CPU ARMv7 Cortex/Scorpion or better 1G Memory 256MB RAM or more 8GB Flash or more Multimedia Common detailed specs Codec acceleration

7

8

9

10

11

12

13 // Game World Texture2D cloudTexture; Vector2 cloudPosition;

14 protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); cloudPosition = new Vector2(0, 0); cloudTexture = Content.Load ("Cloud"); }

15 protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(cloudTexture, cloudPosition, Color.White); spriteBatch.End(); base.Draw(gameTime); }

16

17

18

19

20 graphics.PreferredBackBufferWidth = 240; graphics.PreferredBackBufferHeight = 400;

21

22 protected override void Initialize() { graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft ; graphics.IsFullScreen = true; graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 480; }

23 Vector2 cloudSpeed = new Vector2(1.5f, 0); protected override void Update(GameTime gameTime) { cloudPosition += cloudSpeed; base.Update(gameTime); }

24

25 interface ISprite { void Draw(CloudGame game); void Update(CloudGame game); } // Game World List gameSprites = new List ();

26 class Cloud : CloudGame.ISprite { public Texture2D CloudTexture; public Vector2 CloudPosition; public Vector2 CloudSpeed; public void Draw(CloudGame game)... public void Update(CloudGame game)... public Cloud(Texture2D inTexture, Vector2 inPosition, Vector2 inSpeed)... }

27 Vector2 position = new Vector2(rand.Next(GraphicsDevice.Viewport.Width), rand.Next(GraphicsDevice.Viewport.Height)); Vector2 speed = new Vector2(rand.Next(0, 100) / 100f, 0); Cloud c = new Cloud( cloudTexture, position, speed); gameSprites.Add(c);

28 protected override void Update(GameTime gameTime) { foreach (ISprite sprite in gameSprites) sprite.Update(this); base.Update(gameTime); }

29

30

31

32

33 public bool CloudContains(Vector2 pos) { if (pos.X < CloudPosition.X) return false; if (pos.X > (CloudPosition.X + CloudTexture.Width)) return false; if (pos.Y < CloudPosition.Y) return false; if (pos.Y > (CloudPosition.Y + CloudTexture.Height)) return false; return true; }

34

35

36

37

38

39 while (TouchPanel.IsGestureAvailable) { GestureSample gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.Flick) { waterCloud.CloudSpeed = gesture.Delta / 100f; }

40

41

42

43

44

45 Accelerometer accel; private void startAccelerometer() { accel = new Accelerometer(); accel.ReadingChanged += new EventHandler (accel_ReadingChanged); accel.Start(); }

46 Vector3 accelReading; void accel_ReadingChanged(object sender, AccelerometerReadingEventArgs e) { lock (this) { accelReading.X = (float)e.X; accelReading.Y = (float)e.Y; accelReading.Z = (float)e.Z; }

47 Vector3 getAccReading() { Vector3 result; lock (this) { result = new Vector3(accelReading.X, accelReading.Y, accelReading.Z); } return result; }

48 Vector3 acceleration = game.getAccReading(); CloudSpeed.X -= acceleration.Y * 0.1f; CloudPosition += CloudSpeed;

49

50

51 void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { if (e.Error == null) { mapImage = Texture2D.FromStream(graphics.GraphicsDevice, e.Result); }

52

53

54

55

56

57

58

59

60

61

62


Download ppt "Display 480x800 QVGA 320x480 HVGA Capacitive touch 4 or more contact points Camera 5 mega pixels or more Dedicated camera button Hardware buttons."

Similar presentations


Ads by Google