Moving Waves script

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Moving Waves script

Post by Lafamya » Wed Dec 09, 2015 5:10 pm

Hi,
Thank you so much for all these great lessons I have gained so much information since I start LiveCode you are amazing! :D
I'm trying to move two waves in my game :cry: 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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Moving Waves script

Post by richmond62 » Wed Dec 09, 2015 6:30 pm

You probably have to have a look at "random" in the in-built help system.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Moving Waves script

Post by richmond62 » Wed Dec 09, 2015 7:25 pm


richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Moving Waves script

Post by richmond62 » Wed Dec 09, 2015 7:31 pm

If you want to change the speed the waves move at you need
to look at "moveSpeed" in the in-built help system.

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Re: Moving Waves script

Post by Lafamya » Wed Dec 09, 2015 7:46 pm

I will try that thank you thank you so much :)

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Re: Moving Waves script

Post by Lafamya » Wed Dec 09, 2015 7:50 pm

i'm really grateful thank you

geoffcanyon
Posts: 53
Joined: Thu Aug 15, 2013 9:25 am

Re: Moving Waves script

Post by geoffcanyon » Wed Dec 09, 2015 8:10 pm

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Moving Waves script

Post by richmond62 » Wed Dec 09, 2015 8:24 pm

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.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Moving Waves script

Post by capellan » Fri Dec 11, 2015 5:29 am

Richmond, download this version reduced from 482k to 38k... :D

1) Changed background bitmap from PNG to JPG
2) Changed two waves.png bitmaps to vector graphics

Al

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Moving Waves script

Post by richmond62 » Fri Dec 11, 2015 7:11 am

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.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Moving Waves script

Post by capellan » Fri Dec 11, 2015 7:31 am

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.
Last edited by capellan on Fri Dec 11, 2015 6:43 pm, edited 1 time in total.

Klaus
Posts: 14184
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Moving Waves script

Post by Klaus » Fri Dec 11, 2015 12:46 pm

Hi Lafamya,

1. welcome to the forum! :D

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" 8)


Best

Klaus

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Re: Moving Waves script

Post by Lafamya » Fri Dec 11, 2015 4:34 pm

Thank you! and sorry for that :)

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Re: Moving Waves script

Post by Lafamya » Fri Dec 11, 2015 6:21 pm

Can you tell me how I can change the size of the stack and the waves please?

Thanks!

Lafamya
Posts: 16
Joined: Sun Nov 08, 2015 6:16 am

Re: Moving Waves script

Post by Lafamya » Fri Dec 11, 2015 6:23 pm

Hi richmond62

Lafamya wrote:Can you tell me how I can change the size of the stack and the waves please?

Thanks!

Post Reply