Reply
04 Jun 2012
By: Ac3_l1ghtn1ng Member 83 Posts
Level 1
Offline

scene switcher

30 Replies 631 Views Created 04-06-2012

Hi everyone i'm trying to make a 2D strategy game but i'm stuck right at the beginning of my project I've made a main page using both the playstation suite studio and the UICompose but i want to make the current scene to change into my character select screen when my button is pressed. Any advice would be greatly appreciated.

Please use plain text.
Reply
0 Kudos
Message 1 of 31 (631 Views)
Reply
0 Kudos
Level 4
 

Re: scene switcher

Hello!  In your .cs that was created by the UIComposer (let's just say its called MyScene.cs), add these lines outside of the MyScene() method:

 

public override void Update (float elapsedTime)
{
      //Do what you want here (Input, Logic, etc.)
}

 

Tell me how it goes.


Please use plain text.
Reply
0 Kudos
Message 2 of 31 (621 Views)
Reply
0 Kudos
Level 4
 

Re: scene switcher

[ Edited ]

This is a point of confusion ( and a naming mistake IMHO ), but a UI Scene and a GameEngine2D scene are two completely different things and can be used side by side.

 

I am posting a tutorial shortly that illustrates this, but in the meantime, all you do is handle your regular scene and ui scene in your game loop.

 

This is an excerpt of the game loop from an upcoming sample that illustrates what I mean:

 

while(!quit)
			{
				Director.Instance.Update();
				Director.Instance.GL.Context.Clear();
				Director.Instance.Render();
				
				UISystem.Update(Touch.GetData(0));
				UISystem.Render();
				
				Director.Instance.GL.Context.SwapBuffers();
				Director.Instance.PostSwap();
			}

 

So, what you do is for example, add flag such as "bRenderUI" and if it is true, call UISystem.Update() and Render(), otherwise don't.  Or alternatively, remove all "scenes" from UISystem when not visible.

Please use plain text.
Reply
0 Kudos
Message 3 of 31 (607 Views)
Reply
0 Kudos
Level 4
 

Re: scene switcher

Post is up now, hopefully it illustrates what you need.

Please use plain text.
Reply
Message 4 of 31 (595 Views)
Reply
Level 6
 

Re: scene switcher

Ac3_l1ghtn1ng : Please let us know if you need any more help.

Thanks.
PlayStation®Mobile Dev Team
Please use plain text.
Reply
0 Kudos
Message 5 of 31 (545 Views)
Reply
0 Kudos
Level 1
 

Re: scene switcher

thanks for the help everyone unfortunately after reading all the posts multiple times i just can't get it working and i've realised i just don't have enough knowledge in the area so i just want to know if any of you guys know of a good way for me to learn how to use the playstation suite studio properly and then if I have any problems i might understand the solutions better

Please use plain text.
Reply
0 Kudos
Message 6 of 31 (507 Views)
Reply
0 Kudos
Level 4
 

Re: scene switcher

A very good start would be to just run the samples that come with the SDK.

Then find out which topics you would like to know more about and see how that is done in the examples.

The Tutorial sample for example may help you a lot.

 

Please use plain text.
Reply
Message 7 of 31 (471 Views)
Reply
Level 7
 

Re: scene switcher

Hi Ac3_l1ghtn1ng,

 

It's great to see your enthusiasm and involvement in PlayStation Mobile. Keep up the good work !

 

I wish to guide you in the right direction so that you can make the most of PlayStation Mobile and have fun while doing it too !

 

I understand that you are trying to make a strategy game, which is a very large project. Perhaps you would consider starting with something smaller, Pong for example. You will be surprised at the amount of work that goes into such a small game. There are a lot of resources online in terms of how you can create similar classic games.

 

The reason I mention a small project is so that you can understand the basic framework of a PlayStation Mobile project. It is absolutely essential to understand the design of your program before you actually start coding. It is always advisable to think 2 steps ahead of what you would like to do and how you would achieve it in code. So a piece of paper with some roughly sketched game screens and how you would want to switch between those game screens would be a great start. You will save a lot more time with some prior thinking and many of your issues will be eliminated beforehand.

 

I am assuming that you have a basic understanding of C# , Classes and Objects. If not, please feel free to have a quick refresh so that you know the basic tools that are used and can quickly identify the syntax.

 

Finally, the documentation is your best friend. It is advisable to thoroughly go through the resources provided with PlayStation Mobile. These include the SDK documentation and the sample projects. Under samples you will find a tutorial folder. This tutorial is supported by a programming guide in the documentation. Following it step by step should provide a good foundation for your future projects. It also explains the basic framework of a PlayStation Mobile Project.

 

Last but not least, remember to have fun. With a little hard work and persistence you will soon be able to make your strategy game.

 

Please let us know if you have any problems and we would be happy to help. A big thanks for our helpful community for pointing new users in the right direction. Keep up the good work !

 

Best Regards

M

 


PlayStation®Mobile Dev Team
I am like you, I have no name.
Please use plain text.
Reply
Message 8 of 31 (414 Views)
Reply
Level 1
 

Re: scene switcher

thanks for the help mshkla04,

 

i did do a bit of C# using xna. as for designing it on paper i already have my game fully playable on paper but i've decided to follow some tutorials and write a logbook hopefully that willl give me a better understanding. thanks everyone for the helpful advice

Please use plain text.
Reply
0 Kudos
Message 9 of 31 (405 Views)
Reply
0 Kudos
Level 1
 

Re: scene switcher

alright guys i'm back after a lot of work and help and managed to get my scene switching ability but i'm stuck on trying to make rolling dice. What I'm trying to do is when the scene is loaded 3 timers start and while the timers are running 3 image boxes change the current image to random images (i know how to do that) and when the timers stop the number affects a points table. but i want to focus on the dice rolling before i worry about the points table

Please use plain text.
Reply
0 Kudos
Message 10 of 31 (286 Views)
Reply
0 Kudos