Hello. im new around here and i started to create a simple game (untill i level up my skills) and found myself facing an issue. i needed to create a health bar that will be shrinking from one side only i.e. aligned to the left. i found some solutions and videos on this matter, however, they all refer to a static health bar. it didnt work for me because my health bar was dinamically moving along with its corresponding enemy. and since this health bar was also spawn dinamically i couldnt go into its backstage and do changes to it.
i dont know if this method is the best but since it took me quite some time to figure out the formula i thought mybe i'll share it here.
so first i created a table with 2 columns (health, positionX,)
next, i set a timer on the enemy actor "every 0 sec" change table value "table1.positionX" to self.position.x (i.e. report to the table its current X position)
in the health bar actor i used a constrain "self.size.width" to "table1.health"
and another constrain "self.position.x" to a formula that goes like this:
a little explanation (think of the formula as A-(((B-C/2)+100/2)-D):
A is table1.positionX (constantly changing by the enemy actor).
B-C is the same current position subtracted by half of the current health.
100 is the initial health for this enemy (so if you have a different value for your enemy you need to change this or you can use a global attribute).
and D is again the positionX from the table.
this will result in a moving health bar (according to its corresponding enemy actor) by aligning it to the center of the enemy minus 5 pixeles for each hit, half the damage each hit causes, and will shrink from the right.
i hope i didnt make it too complicated.
thanks. it took me quite some time to figure it out...
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
Here's a nice simple tutorial that shows you how to sort a table from high to low. This tutorial/demo would be helpful if you were creating a local leaderboard, for example.
PhilipCCEncounter Bay, South AustraliaMemberPosts: 1,390
@SnapFireStudios said:
Hey guys, how about we start a Google Drive Spreadsheet with all of these listed? Columns could be Contributor, Name, Description, and Download link.
Sounds like a great idea. I mostly read the Forum using my iPad so when I often find gems in old threads and don't write down exactly where where they are, or download them immediately when I get on my iMac, I sometimes spend ages trying to find them again to learn something or use in a project.
This thread alone for example, is already 20 pages long and will keep growing. If you recall there is something in particular here that you'd like try out it can take a long time to find it again.
The question is - can you make an add-only sheet? I don't believe so. We wouldn't want someone coming in and deleting all of them, and one person managing a read-only one would be difficult.
A library looked after by the mods would be good but a database would have to be created which means a lot of work for someone so probably not practical.
@SnapFireStudios said:
Hey guys, how about we start a Google Drive Spreadsheet with all of these listed? Columns could be Contributor, Name, Description, and Download link.
The original download link, though some are no longer available
A mirror on the Google Drive associated with this account
A link to the specific post in this thread for that item
When someone linked to their own site with multiple downloads, I've not mirrored them - I'll contact the individuals for permission once the list is up-to-date. If a demo was hosted on a third-party site, or attached to a post in this thread, I've mirrored it. Please let me know if you do not wish your code mirrored and/or listed!
Hopefully I've actually got it set to read-only and I'm not going to lose the last hour's work
It'll take a fair bit of time to get through all 20 pages, but I'll chug away at it.
I'm also going to PM the login details for the account to Socks, as the thread-starter and motivator.
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
Wow, @Armelline - Great stuff! That must be a tedious job! Thanks for taking the time to do that!
Here's one I think may be appropriate to add - not because of the complexity, but because of how many people have messaged me via PM or through email asking how they would do this.
Detect how many times a specific variable appears in a table. Want to know how many times the number 9 appears in a table? This simple demo file will show you how. Works for any number, text, etc.
Here is the letter recognition example that I demonstrated at the July meetup. It can be used to... well... recognize when letters or gestures are drawn on the screen.
You can train it to recognize any letter(s)/gesture(s) you want by modifying the letter recognition table. You simply enter the number sequence that represents the letter/gesture.
Some simple code. Want to use Stretch but have circles or perfect squares in your project?
This here code should solve the issue.
It solves it by effectively applying a reverse stretch. It's ideal for things like HUD or so. Just drop the code into the actor you want to anti-stretch.
This effectively changes the actor's vertical size, so it will expand in relation to other objects and as such is not ideal in every single situation and game.
PhilipCCEncounter Bay, South AustraliaMemberPosts: 1,390
@LumpApps Oh wow! This is really clever…it inspires all kinds of things. Thanks.
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
@LumpApps said:
Time for me to do some community love. Here is a proto for making a game with trams or whatever following a track you build on the fly.
Comments
Hello. im new around here and i started to create a simple game (untill i level up my skills) and found myself facing an issue. i needed to create a health bar that will be shrinking from one side only i.e. aligned to the left. i found some solutions and videos on this matter, however, they all refer to a static health bar. it didnt work for me because my health bar was dinamically moving along with its corresponding enemy. and since this health bar was also spawn dinamically i couldnt go into its backstage and do changes to it.
i dont know if this method is the best but since it took me quite some time to figure out the formula i thought mybe i'll share it here.
so first i created a table with 2 columns (health, positionX,)
next, i set a timer on the enemy actor "every 0 sec" change table value "table1.positionX" to self.position.x (i.e. report to the table its current X position)
in the health bar actor i used a constrain "self.size.width" to "table1.health"
and another constrain "self.position.x" to a formula that goes like this:
table1.positionX-(((table1.positionX-table1.health/2)+100/2)-table1.positionX)
a little explanation (think of the formula as A-(((B-C/2)+100/2)-D):
A is table1.positionX (constantly changing by the enemy actor).
B-C is the same current position subtracted by half of the current health.
100 is the initial health for this enemy (so if you have a different value for your enemy you need to change this or you can use a global attribute).
and D is again the positionX from the table.
this will result in a moving health bar (according to its corresponding enemy actor) by aligning it to the center of the enemy minus 5 pixeles for each hit, half the damage each hit causes, and will shrink from the right.
i hope i didnt make it too complicated.
good day.
@jackhammer1000 -- great solution! Thanks for sharing with the community!
thanks. it took me quite some time to figure it out...
Here's a nice simple tutorial that shows you how to sort a table from high to low. This tutorial/demo would be helpful if you were creating a local leaderboard, for example.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hey guys, how about we start a Google Drive Spreadsheet with all of these listed? Columns could be Contributor, Name, Description, and Download link.
-- Thomas
Also - That's really incredible @StormyStudio - It's something that I never really thought was possible in GS. Keep up the great work!
-- Thomas
Sounds like a great idea. I mostly read the Forum using my iPad so when I often find gems in old threads and don't write down exactly where where they are, or download them immediately when I get on my iMac, I sometimes spend ages trying to find them again to learn something or use in a project.
This thread alone for example, is already 20 pages long and will keep growing. If you recall there is something in particular here that you'd like try out it can take a long time to find it again.
The question is - can you make an add-only sheet? I don't believe so. We wouldn't want someone coming in and deleting all of them, and one person managing a read-only one would be difficult.
Any ideas?
-- Thomas
A library looked after by the mods would be good but a database would have to be created which means a lot of work for someone so probably not practical.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
Holy Cow! Mr. Stormy -- how did I miss this?!?! Thanks so much for sharing all the work you put into this!
Excellent idea! Here's the first four pages:
https://docs.google.com/spreadsheets/d/1pTNnPV6VS0fAMuSei0Hf3e6S2p7NZF3gViGk0m72sYU/edit?usp=sharing
I've included:
When someone linked to their own site with multiple downloads, I've not mirrored them - I'll contact the individuals for permission once the list is up-to-date. If a demo was hosted on a third-party site, or attached to a post in this thread, I've mirrored it. Please let me know if you do not wish your code mirrored and/or listed!
Hopefully I've actually got it set to read-only and I'm not going to lose the last hour's work
It'll take a fair bit of time to get through all 20 pages, but I'll chug away at it.
I'm also going to PM the login details for the account to Socks, as the thread-starter and motivator.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Very nice!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Armelline Thanks that's great a well deserved Awesome.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@Armelline Thanks, this is great! Yes, it is set to Read Only.
Nicely done @Armelline
And thanks to the thanks from peeps for sharing my A* pathfinding.
Pages 1-6 in the spreadsheet so far!
For more info see my previous post: http://forums.gamesalad.com/discussion/comment/493089/#Comment_493089
For the spreadsheet, visit:
https://docs.google.com/spreadsheets/d/1pTNnPV6VS0fAMuSei0Hf3e6S2p7NZF3gViGk0m72sYU/edit?usp=sharing
And damn Socks, that shadow demo.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Wow, @Armelline - Great stuff! That must be a tedious job! Thanks for taking the time to do that!
Here's one I think may be appropriate to add - not because of the complexity, but because of how many people have messaged me via PM or through email asking how they would do this.
Detect how many times a specific variable appears in a table. Want to know how many times the number 9 appears in a table? This simple demo file will show you how. Works for any number, text, etc.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Awesome @Armelline - Exactly what I was hoping for
-- Thomas
Fantastic and appreciated effort @Armelline ! Thank you!
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Letter/Gesture Recognition
Here is the letter recognition example that I demonstrated at the July meetup. It can be used to... well... recognize when letters or gestures are drawn on the screen.
You can train it to recognize any letter(s)/gesture(s) you want by modifying the letter recognition table. You simply enter the number sequence that represents the letter/gesture.
http://www.mediafire.com/download/dr99baoefukc1dr/letterRecognitionDemo.zip
Some amazing stuff going on in this thread since i last checked in!
Thanks for setting up that doc @Armelline
@RThurman I was floored and completely enthralled by you demo at the Meet-Up.
Thanks for allowing us to download and play with it.
Maybe you better mention here the caveat on using the example alphabet (that you said was copyright) on the right of the demo here?
Wow !
I love this thread
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
great job! well done
John Gallagher
Artist, cartoonist, developer - STORYTELLER
First GameSalad App JUST PUBLISHED! Roboy Red: Jetpack Attack!
https://itunes.apple.com/us/app/roboy-red-jetpack-attack/id896014716?mt=8
great job! well done
John Gallagher
Artist, cartoonist, developer - STORYTELLER
First GameSalad App JUST PUBLISHED! Roboy Red: Jetpack Attack!
https://itunes.apple.com/us/app/roboy-red-jetpack-attack/id896014716?mt=8
Some simple code. Want to use Stretch but have circles or perfect squares in your project?
This here code should solve the issue.
It solves it by effectively applying a reverse stretch. It's ideal for things like HUD or so. Just drop the code into the actor you want to anti-stretch.
This effectively changes the actor's vertical size, so it will expand in relation to other objects and as such is not ideal in every single situation and game.
Enjoy!
Time for me to do some community love. Here is a proto for making a game with trams or whatever following a track you build on the fly.
Lump Apps and My Assets
@LumpApps Oh wow! This is really clever…it inspires all kinds of things. Thanks.
Wow that's awesome! Thanks for sharing!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx