determining the height
cyberghost
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.
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
-
jckmcgraw Posts: 647@cyberghost
Just to clarify what you are asking... So you want to have an integer attribute constantly keeping track of what that distant is? -
jckmcgraw Posts: 647@cyberghost
Ok. It would require quite a few game attributes though. Does that matter? Why exactly do you need to know the distance? -
jckmcgraw Posts: 647@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 -
RThurman Posts: 2,880@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 -
jckmcgraw Posts: 647@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 -
jckmcgraw Posts: 647@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 -
MotherHoose Posts: 2,456tables 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!
MH
-
jckmcgraw Posts: 647@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 -
MotherHoose Posts: 2,456@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 …
MH
This discussion has been closed.
Answers
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.
i will send my thought also about this.
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.
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?
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..
the game salad forums have degenerated to people posting temporary links at eachother.
Please don't post 'off-topic' in very old posts.
Thread closed.