on 11-05-2012 05:31 PM
And here we have the first component of my game. ![]()
It may be whack a mole? lol
--------------------------------------------------
using System;
using System.Collections.Generic;
using Sce.Pss.Core;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Imaging;
using Sce.Pss.Core.Input;
using Sce.Pss.HighLevel.GameEngine2D;
using Sce.Pss.HighLevel.GameEngine2D.Base;
namespace ss
{
public class AppMain
{
static protected GraphicsContext graphics;
static GamePadData gamePadData;
public static void Main (string[] args)
{
Director.Initialize();
var width = Director.Instance.GL.Context.GetViewport().Width;
var height = Director.Instance.GL.Context.GetViewport().Height;
var scene=new Scene();
scene.Camera.SetViewFromViewport();
var ti=new TextureInfo(
new Texture2D("/Application/rect.png", false));
var sprite=new SpriteUV() {TextureInfo=ti};
sprite.Quad.S=ti.TextureSizef;
sprite.CenterSprite();
sprite.Position = scene.Camera.CalcBounds().Center;
scene.AddChild(sprite);
Director.Instance.RunWithScene(scene,true);
bool gameOver = false;
while(!gameOver)
{
Sce.Pss.HighLevel.GameEngine2D.Director.Instance.U
gamePadData = GamePad.GetData(0);
Random rand = new System.Random();
float x;
float y;
int dirX;
int speed = 5;
Sce.Pss.Core.Vector2 v = sprite.Position;
dirX = rand.Next(2) > 0 ? 1 : -1;
if((gamePadData.Buttons & GamePadButtons.Left) != 0)
{
v.X -= speed;
}
if((gamePadData.Buttons & GamePadButtons.Right) != 0)
{
v.X += speed;
}
if((gamePadData.Buttons & GamePadButtons.Up) != 0)
{
v.Y += speed;
}
if((gamePadData.Buttons & GamePadButtons.Down) != 0)
{
v.Y -= speed;
}
sprite.Position = v;
if(Input2.GamePad0.Circle.Press == true)
gameOver = true;
Sce.Pss.HighLevel.GameEngine2D.Director.Instance.R
Sce.Pss.HighLevel.GameEngine2D.Director.Instance.G
Sce.Pss.HighLevel.GameEngine2D.Director.Instance.P
}
Director.Terminate();
}
}
}
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870