Page 1 of 2
Moving Waves script
Posted: Wed Dec 09, 2015 5:10 pm
by Lafamya
Hi,
Thank you so much for all these great lessons I have gained so much information since I start LiveCode you are amazing!
I'm trying to move two waves in my game

I spend two days changing in my script and still didn't work. In the middle of my stack there is two waves in the buttons I want to move these two button waves up and down in different speed and every different time, can you please help me doing that
I really appreciate your help!
Thanks
Lamya
Re: Moving Waves script
Posted: Wed Dec 09, 2015 6:30 pm
by richmond62
You probably have to have a look at "random" in the in-built help system.
Re: Moving Waves script
Posted: Wed Dec 09, 2015 7:25 pm
by richmond62
Re: Moving Waves script
Posted: Wed Dec 09, 2015 7:31 pm
by richmond62
If you want to change the speed the waves move at you need
to look at "moveSpeed" in the in-built help system.
Re: Moving Waves script
Posted: Wed Dec 09, 2015 7:46 pm
by Lafamya
I will try that thank you thank you so much

Re: Moving Waves script
Posted: Wed Dec 09, 2015 7:50 pm
by Lafamya
i'm really grateful thank you
Re: Moving Waves script
Posted: Wed Dec 09, 2015 8:10 pm
by geoffcanyon
https://app.box.com/s/9xyiy1k09omuw8nw377qdr9xlq8uqrgc
I made some modifications:
1. The splash button is now a checkbox -- check it, the movement starts, uncheck it, the movement stops.
2. The move commands are all now "without waiting" so the waves and the pirate move simultaneously.
3. The parameter of how fast to move is in the move command, and randomized a bit, so everything isn't changing directions always at the same time.
4. The parameters of where to move are in custom properties on the graphics, so a single routine can handle all of them.
Re: Moving Waves script
Posted: Wed Dec 09, 2015 8:24 pm
by richmond62
You have ironed out the jerkiness, which makes things a whole lot better,
as well as moving the move scripts into the card rather than in the button.
Re: Moving Waves script
Posted: Fri Dec 11, 2015 5:29 am
by capellan
Richmond, download this version reduced from 482k to 38k...
1) Changed background bitmap from PNG to JPG
2) Changed two waves.png bitmaps to vector graphics
Al
Re: Moving Waves script
Posted: Fri Dec 11, 2015 7:11 am
by richmond62
I have been 'hooked' on PNG images for a while now as believed (possibly wrongly) that GIF images
were things of the past, and didn't know of any other image formats that included transparency that
LiveCode could handle.
If there is full capability to import Vector images into LiveCode and they are smaller than their PNG equivalents
that is a two-way gain.
Re: Moving Waves script
Posted: Fri Dec 11, 2015 7:31 am
by capellan
Hi Richmond,
richmond62 wrote:I have been 'hooked' on PNG images for a while now as believed (possibly wrongly) that GIF images
were things of the past, and didn't know of any other image formats that included transparency that
LiveCode could handle.
If there is full capability to import Vector images into LiveCode and they are smaller than their PNG equivalents
that is a two-way gain.
Using Gimp, it was really easy to save Sky.png file as jpg
while controling file compression visually.
Using Inkscape, it was easy to trace automatically the bitmap waves.png.
and import this svg file into LiveCode using SVGL.
By the way, LiveCode Forum users could find very useful the creation of
a sub-forum named Media Editors (or any other descriptive name)
categorized as:
1) Text editors - 2) Audio editors - 3) Image editors - 4) Video editors
5) Vector Graphics editors - 6) Database editors - 7) External editor, etc.
In these sub-forums developers could publish tips and their most efficient
workflows while using these editors to create content included
within Livecode stacks.
Re: Moving Waves script
Posted: Fri Dec 11, 2015 12:46 pm
by Klaus
Hi Lafamya,
1. welcome to the forum!
2. Please only ONE posting per problem!
I will delete the double posting in the "App Building Course" forum,
which is really only meant to discuss the, you guess, "App Building Course"
Best
Klaus
Re: Moving Waves script
Posted: Fri Dec 11, 2015 4:34 pm
by Lafamya
Thank you! and sorry for that

Re: Moving Waves script
Posted: Fri Dec 11, 2015 6:21 pm
by Lafamya
Can you tell me how I can change the size of the stack and the waves please?
Thanks!
Re: Moving Waves script
Posted: Fri Dec 11, 2015 6:23 pm
by Lafamya
Hi richmond62
Lafamya wrote:Can you tell me how I can change the size of the stack and the waves please?
Thanks!