Spare Code ? Dump It here.

1141517192027

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934

    @Braydon_SFX said:
    Ah this thread is finally a sticky!

    EDIT: Or maybe not...

    It is. Just not on the main page. It's announced inside its sub forum.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926
    edited February 2015

    Custom Variable-Interval Timer™

    The built-in Timer behavior maintains the same duration regardless of what the expression it uses changes to. So for example if you use a Timer set to Every random(1,5) seconds, it won't continually pick a new value. It will just pick an initial value (e.g. 2 seconds) and always repeat that duration.

    To have a random duration, you'll need a custom timer. This demo provides a way to create a random interval between iterations of the timer.

    For an explanation of how the rules work, see this.

    https://www.dropbox.com/s/dmvxe74sq6ivrzc/Custom Timer.zip

    The trademark is for @RThurman who came up with the name ;)

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

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

    @tatiang -- very nice demo for variable interval timers.
    Thanks for sharing this great tip with the community!

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

    Wobbly, swerving, pseudo-random paths for wobbly, swerving, pseudo-random characters !! :)

    Broken Steering Wheel

    Curley Wurley

    Curved grid

    Dancing Bees

    Doughnuts

    Etch-a-sketch

    Lost Ant

    Nodules

    Occasional Bump

    Perm Machine

    Rising

    Smooth lumps

    Spaghetti

    Sudden Turn

    Wobbly Signature

    Zig-Zag

    Link: https://www.mediafire.com/?p920m99b6pz2v9q

  • quantumsheepquantumsheep Member Posts: 8,188

    @‌Socks

    Useful stuff - thanks! :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • SocksSocks London, UK.Member Posts: 12,822

    @Hopscotch said:

    Lol ! Not sure whether to say thank you or call the police. :)

  • SocksSocks London, UK.Member Posts: 12,822

    Very rudimentary but it's come up a few times, a basic move through a starfield.

    Link: https://www.mediafire.com/?gj23vfz5zcqfq8s

  • SocksSocks London, UK.Member Posts: 12,822

    Creature of most awful horror:

    Link: https://www.mediafire.com/?kduqrrfk44ai0a7

    Falls apart after a while, but as a basic idea it sort works.

  • quantumsheepquantumsheep Member Posts: 8,188

    @Socks said:
    Very rudimentary but it's come up a few times, a basic move through a starfield.

    Link: https://www.mediafire.com/?gj23vfz5zcqfq8s

    Very nice - it inspired me to go fix my own star field, though it doesn't use the same technique - is it not a bit performance intensive to spawn/destroy all those stars?

    @Socks said:
    Creature of most awful horror:

    Link: https://www.mediafire.com/?kduqrrfk44ai0a7

    Falls apart after a while, but as a basic idea it sort works.

    I was expecting a flappy bird ;)

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • SocksSocks London, UK.Member Posts: 12,822

    @quantumsheep said:
    is it not a bit performance intensive to spawn/destroy all those stars?

    Sure is, but it runs fine on my iPad3 using 10.4, should run even better on newer creator versions, using TGAs and on newer and faster iPads / mobiles + I don't really optimize demo files, just chuck them together to illustrate the idea.

  • SocksSocks London, UK.Member Posts: 12,822

    @quantumsheep said:
    I was expecting a flappy bird

    :smile:

  • StormyStudioStormyStudio United KingdomMember Posts: 3,987
    edited April 2014

    @Socks said:
    Creature of most awful horror:

    Link: https://www.mediafire.com/?kduqrrfk44ai0a7

    Falls apart after a while, but as a basic idea it sort works.

    with a description like that I just had to check it out... very freaky... (...I like the guys pajamas.)

    edit: just played it again... it really is pretty horrid. great work.

  • SocksSocks London, UK.Member Posts: 12,822

    Don't watch it before you go to bed.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926
    edited April 2014

    @Socks

    @Socks said:
    Don't watch it before you go to bed.

    Nor during the day.

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

  • JDuaneJJDuaneJ San Francisco Member Posts: 300

    @Socks said:
    Creature of most awful horror:

    Link: https://www.mediafire.com/?kduqrrfk44ai0a7

    Falls apart after a while, but as a basic idea it sort works.

    Now that's awesome. :o

  • stueynetstueynet TorontoMember Posts: 166
    edited April 2014

    This is not really a full template. I am working on a new game and I built this actor to use as an oscillating saw blade. I needed to have it work both vertically and horizontally as well as adjust the speed of the rotation as well as the oscillation not to mention the distance it moves form side to side and up and down. Its pretty cool so I thought I would post it for people here to enjoy. It is built with RC6 so you have to use that to open it.

    Just drag it into any scene and configure the options. Configurable options are

    • movement (the amount it should move in total pixels from left to right or up and down)
    • moveSpeed (the speed at which it moves through space - this is the amount of seconds it takes to complete a full traversal)
    • rotationSpeed (the speed in which it spins)
    • vertical (check this off to make it move vertically instead of horizontally - default is horizontal)

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926
    edited April 2014

    @stueynet Good stuff. Since it's not really a tutorial, I'm going to merge it with the Spare Code thread. Hope you don't mind.

    It's also a good idea to let people know that your demo was made with the Release Candidate. Edit: oops, I see you did that (RC6).

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

  • stueynetstueynet TorontoMember Posts: 166

    @tatiang said:
    stueynet Good stuff. Since it's not really a tutorial, I'm going to merge it with the Spare Code thread. Hope you don't mind.

    It's also a good idea to let people know that your demo was made with the Release Candidate. Edit: oops, I see you did that (RC6).

    Ok then. But the file is not attached anymore so my comment makes no sense. Also I was planning on adding the video for how it works tomorrow. Either way without the file its pretty useless so feel free to delete the post.

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • SocksSocks London, UK.Member Posts: 12,822

    @stueynet said:
    Ok then. But the file is not attached anymore so my comment makes no sense. Also I was planning on adding the video for how it works tomorrow. Either way without the file its pretty useless so feel free to delete the post.

    Can you not simply attach the file in a post here ? Same deal with the video ?

  • colandercolander Member Posts: 1,610
    edited April 2014

    Here is Table Display v1.00 created in NB254 I have been working on. It is a combination of @ericzingeler Fast For Loops and tshirtbooths Multiscreen Menu system originally by Thomas form Gamesmold.

    This version display a 350 row x 17 column table by spawning 350 rows with 17 text displays, one for each column. This works thanks to the new features in text display. It spawns them in 12 sec on an iMac 15sec on an iPad Air but it crashes an iPad 1 in 15 sec at 150 rows. Maybe someone would like to test it on an iPad 2 and see if it will load.

  • stueynetstueynet TorontoMember Posts: 166

    @Socks‌ @tatiang‌ here is the post again avec the file attachment.

    Ok I will repost the post now with the file attached again. This is a simple oscillating saw blade.

    This is not really a full template. I am working on a new game and I built this actor to use as an oscillating saw blade. I needed to have it work both vertically and horizontally as well as adjust the speed of the rotation as well as the oscillation not to mention the distance it moves form side to side and up and down. Its pretty cool so I thought I would post it for people here to enjoy. It is built with RC6 so you have to use that to open it.

    Just drag it into any scene and configure the options. Configurable options are

    • movement (the amount it should move in total pixels from left to right or up and down)
    • moveSpeed (the speed at which it moves through space - this is the amount of seconds it takes to complete a full traversal)
    • rotationSpeed (the speed in which it spins)
    • vertical (check this off to make it move vertically instead of horizontally - default is horizontal)

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

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

    @stueynet said:
    Socks‌ tatiang‌ here is the post again avec the file attachment.

    Cool ! :)

    It makes a great obstacle to get passed (when in formation like this), from one side of the screen to the other . . . you should make it so that when your hero actor touches a blade it spawns a spurt of blood !

    :)

  • SocksSocks London, UK.Member Posts: 12,822

    @stueynet said:

    P.S. you can also do these kinds of motions with a sine wave.

    Example file:

    (it's not got all the parameter controls of your version, but you get the idea)

    Link: https://www.mediafire.com/?n35mosyczty1l1h

  • stueynetstueynet TorontoMember Posts: 166

    Oh cool. Yes you could for sure.

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • stueynetstueynet TorontoMember Posts: 166

    Great enhancement @Socks‌. Here is the updated file using sin with the parameters in tact.

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • SocksSocks London, UK.Member Posts: 12,822

    @stueynet said:
    Great enhancement Socks‌. Here is the updated file using sin with the parameters in tact.

    That's better ! Works really well.

    Also constraining the rotation to related values (I just copied your movement values and fiddled with them) gives it a nice mechanical feel, as if the wheel are somehow linked to the mechanism moving them . . .

    Example: https://www.mediafire.com/?36cdtg2inn731x0

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,028

    Not sure if this kind of demo has been posted before, but I'll go ahead and attach a quick project I whipped up today. This demo shows you how to take a string and reverse it. This demo is pretty basic, but you could take it to the next level and add each reversed letter to a table cell, or something like that.

    Enjoy!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,028

    Drag to select and deselect demo.

    A simple demo which demonstrates how to click and drag to select actors. You can also deselect actors by simply dragging back over them. This is an extension to the Connected Boxes demo which TShirtBooth created a few years ago.

    Enjoy!

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

    Off-Center Rotations Using a Move Behavior

    This demo shows how to rotate an actor around a different pivot point than its center. It uses a math expression in a Move behavior to determine what to do. (It uses the actor's angular velocity to keep track of just how fast to move in order to keep the actor's 'pivot point' in just the right place on the scene.)

    No trig! Not a sin or cos to be seen in this method! I can't think of an easier way to have off-center rotations.

    http://www.mediafire.com/download/zytrxwzfh11ah7b/OffCenterRotationViaMoveBehavior.zip

Sign In or Register to comment.