determining the height

cyberghostcyberghost Member Posts: 17
please take a look on this link > http://www.icyber-ghost.com/illustration/index.php

I got a first project that prototype as the above link.

I was looking on some solution or any GS function to identify the height (labeled green) on the stable platform ( gray one ) to its next platform( red, movable platform). considering that there are variations (diff. height and width) of movable platform.

There are several arrangement of platforms that follows after this. I was thinking to identify dynamically the height.


the hardest part for me here is that to identify the heights (green arrowed gap) of the preceeding platforms.

Best Answers

  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    Just to clarify what you are asking... So you want to have an integer attribute constantly keeping track of what that distant is?
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    Ok. It would require quite a few game attributes though. Does that matter? Why exactly do you need to know the distance?
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    There we go, now I see what you are saying. As of right now this doesn't seem like a simple solution, so I'll see if I have time tomorrow to sort this one out.

    Regards,
    Jack McGraw
  • RThurmanRThurman Posts: 2,879
    Accepted Answer
    @cyberghost -- if you are trying to find the difference between the top of the gray box and the top of the red box the general formula looks something like:

    distance = (graybox.Y+(graybox.height/2))-(redbox.Y+(redbox.height/2))

    Hope that helps
    RThurman
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    Hello,

    Just got home from school today and finished up a demo for what you are looking for. Depending on how high you fall from, you will lose health damage. With a few small alterations, this demo will work no matter where you place platforms in your game, and requires a minimal # of attributes.

    http://dl.dropbox.com/u/16233669/falling health damage.gameproj.zip

    Let me know if you have any questions about the demo. You can also email me (jckmcgraw@gmail.com).

    Hope this helps,
    Jack McGraw
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    Don't overthink GameSalad... You'll just want an integer attribute. Then when you overlap or collide (rule) with an object, change attribute game.collectableobjects (or whatever), to game.collectableobjects + 1

    Regards,
    Jack McGraw
  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    tables in GS are our arrays for storing values

    loved @jckmcgraw demo … colorful and so efficient!

    I had started a demo using tables … thought Jack's was much better

    but you could download my example for tables implementation:
    http://www.mediafire.com/?o1h94g1biogwm9r

    ==
    so many ways to creatively create in GS!

    image MH
  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @cyberghost

    With tables, you can insert a bunch of info (attributes), but you cannot change the table cells on the fly. All you can do is retrieve the values that you put in.

    GS is working on implementing writable tables in the next one or 2 updates.

    Regards;
    Jack McGraw
  • MotherHooseMotherHoose Posts: 2,456
    edited May 2012 Accepted Answer
    @cyberghost … you can fetch any of the data you stored in a table …
    expression editor: Functions for tables

    to learn about GS tables … watch: http://gshelper.com/?p=450
    and the other @tshirtbooth tables videos … most with downloads of projectFiles

    his work made tables easy for us …

    image MH

Answers

  • cyberghostcyberghost Member Posts: 17
    yeah getting the distant on every consecutive platform.
  • cyberghostcyberghost Member Posts: 17
    hmm it does not matter of how many attributes involved.

    My goal is that to get he distance between the proceeding platform for me this conditions.

    [game situation]
    lets say when the user (player) used to catch the actor in 100 px or more (height). the actor will take a considerable about of damage.
  • cyberghostcyberghost Member Posts: 17
    thank you sir.

    i will send my thought also about this.
  • cyberghostcyberghost Member Posts: 17
    @RThurman > formula dude. this very quite understable ( quite an analytical geometry solution ).

    but the thought of getting the preceeding distances on approaching boxes is quite a hell to me... i was thinking that there are some array object handler. but i guess there is not.
  • cyberghostcyberghost Member Posts: 17
    @jckmcgraw, thanks sir.. in one way or another the idea there is basically you are putting the danger zone area.

    with this i have done about the logic itself.

    i just wondering if there is a mechanism/codes that collect objects on a scene? like an javascript that capable to fetch/read recursively any object on its container?
  • cyberghostcyberghost Member Posts: 17
    @jckmcgraw, thanks for the advice sir.

    but i was thinking if there is a sort of array objects? i mean its an array variables that get all objects and its details (properties eg. positions, width. height). damn to me.. im start thinking already as javascript already..
  • cyberghostcyberghost Member Posts: 17
    is the table in GS can be updated dynamically? or can that be inserted a new entries? By the way, what im trying to say is that.. can we fetch the objects (e.g platforms, bars) and its attributes and placed on tables? honestly this will be my first time using tables.
  • cyberghostcyberghost Member Posts: 17
    @MotherHoose and @jckmcgraw, wow! this is a great help to me as a beginner.. thanks for your ideas and infos.


  • joshiwujoshiwu Member Posts: 207

    the game salad forums have degenerated to people posting temporary links at eachother.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Please don't post 'off-topic' in very old posts.

    Thread closed.

This discussion has been closed.