# Spare Code ? Dump It here.

• London, UK.Member Posts: 12,822
edited January 2013
Seems to be any value over 1.0 gets rid of the kick? Strangeness.
Not precisely, the solution is to trim off the final 10% of the last whole number of your interpolation (so interpolating to 1.05 wouldn't work if we were interpolating from 0 to 1 for example - as we would still see the glitch).

And the value should be above 1.0 only If you are interpolating up (increasing in value) - if you are interpolating down (decreasing in value) your target to interpolate to should be less than 0.

And if we were interpolating from 4 to 7 we'd need to make sure the target value was above 7 . . . and so on.

It's simply that the last 0.1 (10%) of the value of the final whole number in interpolation is missing - interpolate smoothly interpolates from your start value to 90% of the final whole number, and then jumps straight to 1 (or 0 or whatever it is you are interpolating to) - missing out the last 10% of this final whole number.

This is what interpolate should do (I've simplified this down to 2 decimal places):

0.78
0.79
0.80
0.81
0.82
0.83
0.84
0.85
0.86
0.87
0.88
0.89
0.90
0.91
0.92
0.93
0.94
0.95
0.96
0.97
0.98
0.99
1.00

. . . but this is actually what it does . . .

0.78
0.79
0.80
0.81
0.82
0.83
0.84
0.85
0.86
0.87
0.88
0.89
0.90
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00

So on a move across the width of an iPad screen (using interpolation) - 0 to 1024 pixels - the last 10% of the travel across the final pixel is missing as it jumps straight to 1024 from 1023.9 (rather than getting to 1023.999 . . first) - which as you might imagine is imperceivable.

But this is the little 'kick' you get on the end of image fades and audio ramps - with interpolations that operate on much smaller values (fading the alpha channel up and down (0-1), fading the audio in and out (0-1) . . and so on) it's very noticeable.

The answer is to push the faulty tail-end of the interpolate algorithm out of the useful range of the thing you are interpolating, luckily alpha channels and audio level values can't go lower than 0 or higher than 1 - so pushing the tail-end of the interpolate algorithm outside this range doesn't have any effect on what you see or hear (you don't / can't end up with an alpha channel value of -0.2).

Sorry, long answer for a two line post, but I hope that all makes sense !
• Member Posts: 1,792
Ah ok. I'll use the '10 percent rule' from now on then. Cheers.

On an unrelated note, I'm testing a new game that's not far off from being finished. Fancy having a play of it and offering some feedback?
• London, UK.Member Posts: 12,822
edited January 2013
Ah ok. I'll use the '10 percent rule' from now on then. Cheers.
. . . but only the final 10% of the last whole number ! : )
On an unrelated note, I'm testing a new game that's not far off from being finished. Fancy having a play of it and offering some feedback?
Sure, I'd love to - I'm mostly iPad based.
• Member Posts: 1,792

Sure, I'd love to - I'm mostly iPad based.

Not sure if used testflight before? But you sign up on your device. Then once I accept it at my end I can add your device number a new build.
• London, UK.Member Posts: 12,822
Not sure if used testflight before? But you sign up on your device. Then once I accept it at my end I can add your device number a new build.
. . . . ok . . will do.
• Member Posts: 3,210
edited January 2013

They are quite old and there are much better programmers than me, but perhaps they will help somebody out?

Here is a link to them on my GS profile page. The GS Safari plugin no longer works, but at least you can see their titles and know what you'll be downloading.

Joe
• Member Posts: 5,390

They are quite old and there are much better programmers than me, but perhaps they will help somebody out?

Here is a link to them on my GS profile page. The GS Safari plugin no longer works, but at least you can see their titles and know what you'll be downloading.

Joe
However old @firemaplegames they were the foundations of many people's titles. Some of these have now been adapted but you showed a whole wealth of people where to start! Amazing work, I remember the excitement they bought back then like it was yesterday!
• Member Posts: 106
...I remember the excitement they bought back then like it was yesterday...

This is amazing. Thank You firemaplegames---as a newbie this is great!!
• Member Posts: 5,390

Lovely sentiments, its awesome to see how useful they still are!
• London, UK.Member Posts: 12,822
Great stuff !

>-
• Member, Sous Chef, PRO Posts: 2,867
Here is a starter file for two-touch pinching/zooming and rotating the camera:
• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,947
edited January 2013
@firemaplegames Great looking compilation... thanks for sharing!

[Edit: @RThurman's link works for me now]

Now to dig around in my junk drawer...

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

• Member, Sous Chef, PRO Posts: 2,867
Here is an old favorite of mine. It shows how make an actor rotate around a point you designate (rather than the default center of the actor). It comes in handy for all sorts of things.
• Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,244
Nice one, @RThurman.
• Member Posts: 93
You guys have some great stuff here! Thanks!
• London, UK.Member Posts: 12,822
edited February 2013
Some spare constrain experiments:

http://www.mediafire.com/?9fld3cme7oc7d3o
• Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,244
edited February 2013
Here's a quick project I did for the new Universal Binaries feature. I saw a lot of people asking how to make UB work initially from iPhone instead of iPad. Here it is Note that your art will probably be distorted when it has been resized for iPad. Forgive me if someone has already supplied this - been busy lately and haven't been on too much!
• London, UK.Member Posts: 12,822
. . . been busy lately and haven't been on too much!
You've changed since you got your new title, it's all parties and film premieres for you now, no time for us . . . (
• Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,244
. . . been busy lately and haven't been on too much!
You've changed since you got your new title, it's all parties and film premieres for you now, no time for us . . . (

Well, I wasn't going to say anything, but.....

• Member Posts: 5,390
Had to come up with a way to unlock power ups at random, add the unlock values to a table and then call upon the unlocked values from the table at random. Here is a little demo showing how I did this.
• Member Posts: 2,599
Hey guys,
Since I see lots of sharing here, I might as well share old files that I have.
Inside this link youll find the following templates I've made for GS members way back in the days :P

********
Fire works
HUD example
Screenshot Template (psd)
Search Tables
semi circle movement
Trivia template
Wrap effect
3d RUNNER
Detect attribute change
Herd movement Type 1
Herd movement Type 2
Particles around actor
replicate example
Tower destroy
Accelerometer with portrait detection
Star system like Corpse Granny
tap tard average

And a MEGA template with:
1)Text test
2)Accelerometer input
3)Movements Types
4)tweaked Timers
5)Button Slider
7)Multitouch
8)Particles snow/confetti
9)Extreme testing
10)Game Center implantation
11)App rating system
12)Scene panning
***********************

http://www.mediafire.com/?cm88cl9fiiocw92

I hope someone will find it useful, i know it already helped lots of members!

Cheers
Roy.
• Member Posts: 106
As a newbie, these templates and tutorials are amazing! I have learnt so much. I am still just working on templates to get 'things' to work as they should. My unorganized and inefficient coding is getting better all the time. I am anxious to put together a full game but will continue to battle my impatience until I have a stronger grasp of 'things'. These forums, tutorials and templates have allowed me to progress quickly(in my eyes ) ) and I will soon have the confidence to put all I have learnt into a game or sorts. Thank you so much. One of those times where 'thanks' is not enough.

cheers ^:)^
• Member Posts: 754
My problem with spare code is that I never make a separate file to test it. I always make it in game and then if it doesn't work I delete it or keep the functional part and remove the rest. I've had quite a few things I've done in game that I have no idea what I did because I have no separate file to see what I did. I wish I had dumped it somewhere. So word of advice to new programmers, keep your code!
• Member Posts: 8,188
Nice to see this thread alive with sharing! Keep it up!

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

• Member Posts: 823
• London, UK.Member Posts: 12,822
@P-O-M

Great stuff Roy, I've stolen a few useful bits already !

• Member Posts: 1,603
Wow! Great stuff in here.
I have to agree with @Utveckla_Games; I almost never make separate projects when I come up with cool little things like these. *Note to self* Do that more from now on.
- Thomas
• Member Posts: 1,603
@RThurman - Just checking out your Pinch/Zoom thing. ..Why are all of the controls backwards? They do the opposite of what they normally would on most apps.
- Thomas
• Member Posts: 1,303
edited March 2013
Hey everyone,

Here is the source code to my most popular demos: