playMaker

Author Topic: Make a game like Papa Pear Saga  (Read 4129 times)

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Make a game like Papa Pear Saga
« on: February 01, 2014, 03:53:42 PM »
OK, i sure all here knows this game So, i will try to make this happen with Playmaker style.

1. I thing the hard part is make a wall (left-right and top wall). For this i wondering, is possible to make a code in playmaker like this video of Brackys? 2. OR just use a get screen size, to get a edge location of the camera based on the screen resolution? (4.3'', 3.7'')

Which is the best option?, By the way, how to set all game position (player, wall, stuff, etc) based on which device(screen resolucion) where open the game?

Can anyone help? I put all FSM here when go on this project. Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Make a game like Papa Pear Saga
« Reply #1 on: February 03, 2014, 05:59:15 AM »
Hi,

 I would sample the 3d position based on screensize and position walls using that found position.

 It's easy without knowing the actual size by using normalized screen cooridnates ( 1 being the full width or height), and the action "Screen to World Point".


bye,

 Jean

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Make a game like Papa Pear Saga
« Reply #2 on: February 03, 2014, 10:06:45 AM »
I thing...
Put a FSM with get screen width/height action in MainCamera, so with this value will rest for (pixeles) and then, set the position of right left and top wall.

Expamle:
(Value of width)-(Value of pixel) = Value of position top wall.
(Value of height)-(Value of pixel) = Value of position right wall.
(Value of height)-(Value of pixel) = Value of position left wall.

Correct?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Make a game like Papa Pear Saga
« Reply #3 on: February 04, 2014, 05:56:40 AM »
Hi,

 Nop, use the action "Screen to World Point", and keep the screensize in "Normalized" so that you use 0 and 1 as the screen position.

0,1 means top left corner of the screen
1,0 means bottom right of the screen

once you have that, you can position properly objects in relation to the screen size.

bye,

 Jean
« Last Edit: February 05, 2014, 04:36:49 AM by jeanfabre »

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Make a game like Papa Pear Saga
« Reply #4 on: February 04, 2014, 09:01:33 PM »
Thanks for reply me!
but, you don't have a example?  :-X
How to use this action and then set the wall position?
 PLS

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Make a game like Papa Pear Saga
« Reply #5 on: February 05, 2014, 04:49:33 AM »
Hi,

 Here we go,

bye,

 Jean

xhidnoda

  • Full Member
  • ***
  • Posts: 231
Re: Make a game like Papa Pear Saga
« Reply #6 on: February 06, 2014, 08:19:05 PM »
Thanks Jean!
But...is not a helpme much.
How can traslate this code in playmaker? :(
//Move each wall to its edge location:
        topWall.size = new Vector2(mainCam.ScreenToWorldPoint(new Vector3(Screen.width * 2f, 0f, 0f)).x, 1f);
        topWall.center = new Vector2(0f, mainCam.ScreenToWorldPoint(new Vector3(0f, Screen.height, 0f)).y + 0.5f);

        leftWall.size = new Vector2(1f, mainCam.ScreenToWorldPoint(new Vector3(0f, Screen.height * 2f, 0f)).y); ;
        leftWall.center = new Vector2(mainCam.ScreenToWorldPoint(new Vector3(0f, 0f, 0f)).x - 0.5f, 0f);

        rightWall.size = new Vector2(1f, mainCam.ScreenToWorldPoint(new Vector3(0f, Screen.height * 2f, 0f)).y);
        rightWall.center = new Vector2(mainCam.ScreenToWorldPoint(new Vector3(Screen.width, 0f, 0f)).x + 0.5f, 0f);

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Make a game like Papa Pear Saga
« Reply #7 on: February 07, 2014, 06:10:04 AM »
Hi,

 I see, you are modifying the size as well. Instead keep a fixed size ( bigger than the biggest screen ratio you can expect, and simply move them around using the example I sent.

so modify the cube used in the example provided so that it stretches in height, and do the same with another cube with the same technice but stretched horizontally.

bye,

 Jean