GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

x,y coordinates and scene setup?

Basic question I know, so hopefully a simple one.

I'm following a youtube tutorial to create a flappy birds style game (my first use of GS), to learn the software. When running however the spawned rectangles can sometimes appear in the middle of the screen, i've changed the values on the spawner prototype but cannot get the top and btm bar to appear in the correct y range consistantly.

How is the x,y system set on GS and what am I doing wrong with my math?

Many thanks,
R3born

Best Answer

Answers

  • tatiangtatiang Posts: 11,791Member, Sous Chef, PRO, Senior Sous-Chef

    The coordinate system in GameSalad has zero at the bottom left of the scene. So as you move right, X increases and as you move up, Y increases. Actors' positions are calculated from their centers. So if you have an actor with width and height equal to 80 at X=200, Y=0, it will span an area from X=160 to X=240 and from Y=-40 to Y=40 (half of it will disappear below the scene boundary).

    To know what you're doing wrong, we'd have to see how you have your rules set up.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Posts: 12,822Member
    edited November 2014

    Welcome to the forum ! :)

    @R3BORNUK said:
    How is the x,y system set on GS

    With regards to how GS measures X and Y coordinates . . . basically what tatiang says, 0,0 is the bottom left of the scene, and an actor's coordinates are measured from its centre.

    @R3BORNUK said:
    . . . and what am I doing wrong with my math?

    This is a general point - not specific to your question - but I am always puzzled by posters asking questions about projects that they reveal none of the details about ! It's surprisingly common (and something that's guaranteed to drives me crazy! lol :smiley: ), people will describe an issue caused exclusively by the project's code and ask for possible solutions without divulging any of the code !

    It always comes across to me like this . . .

    "Hey there, I am trying to do this calculation with a bunch of numbers, the result should be 2048, but I keep getting 2110, what am I doing wrong ?"

    So, to the question 'what am I doing wrong with my math?' I'd say, what maths ?

  • R3BORNUKR3BORNUK Posts: 19Member

    Thank you for both of your replies, helps to know the x,y settings (slightly strange compared to other programs)

    In regards to the math, at first I though you where being slightly rude, until I realised that the screen shot I took of my code and settings didn't upload for some reason. So, my bad!

  • R3BORNUKR3BORNUK Posts: 19Member

    Ok, so it doesn't link DB links in the image url box. I'll try here:

    https://dl.dropboxusercontent.com/u/93232546/Capture.PNG

  • R3BORNUKR3BORNUK Posts: 19Member

    The stage is 320 high and the bars are both 250 high

Sign In or Register to comment.