16 January 2016, 22:36 | #1 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
Animating explosion without amal
Hi there,
does anyone has an idea how to animate something (bob), let's say an explosion (5-6 frames) without using amal? initially wanted go go for sth like for a=1 to 5 bob 1,50,50,a next a wait vbl it does not work and it goes straight for the last frame. i mean goes so fast, you cannot see the animation... sounds simple but i have no clue whatsoever... |
16 January 2016, 22:55 | #2 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
You have the right kind of idea, but the Wait Vbl needs to be inside the loop:
Code:
for a=1 to 5 bob 1,50,50,a wait vbl next a |
17 January 2016, 12:10 | #3 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
thanks, and how to slow the animation down? it is too fast using vbl and barely noticable?
|
17 January 2016, 12:40 | #4 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
Add another Wait Vbl after the first one to cut the frame rate in half.
|
17 January 2016, 12:49 | #5 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
now then, what about more complicated example. i animate background and want to draw explosion on top of it. when i use wait vbl, everything gets choppy and does not work as it should, so is there any other way?
|
17 January 2016, 15:36 | #6 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
what do you mean by "choppy"? you should always "wait vbl" every frame. if bobs are flickering, consider using double buffer.
|
17 January 2016, 19:08 | #7 |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
i use vbl in the main routine. what i do is to scroll backgound and then and move bobs around so i cannot stick another wait vbl in the another subroutine as i already have one in main.
|
17 January 2016, 19:11 | #8 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
yes, never use two wait vbls or you'll just slow things down, but that's not what i said.
Double buffering creates two screen buffers, the bobs are drawn to the invisible buffer, and then the buffers are swapped, so you never see the screen half-way through the drawing. It prevents flickering of bobs and other animation. If you are using "screen copy" to scroll the screen around, the bob drawing routine might get confused, because the stored background behind the bobs will be wrong, so you will need to turn "bob update off" and "autoback 0" and do manual "bob clear"/"bob draw" operations to make it work. Clear the bobs, then scroll, then draw the bobs. Then "screen swap" and "wait vbl". Last edited by Mrs Beanbag; 17 January 2016 at 19:17. |
17 January 2016, 19:25 | #9 | |
Registered User
Join Date: Mar 2014
Location: Leeds
Posts: 141
|
Quote:
|
|
17 January 2016, 19:37 | #10 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
i still don't know what you mean by "choppy". if you add another wait vbl of course you will not have smooth animation, because it will halve the frame rate. There should only be one "wait vbl" per frame. If you want your explosion animation to run more slowly, only update its image number every other frame. For instance:
Code:
If (Timer AND 1) Inc A |
17 January 2016, 20:31 | #11 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,781
|
Do you amal? Amal or not to Amal that is the question.
|
17 January 2016, 20:34 | #12 |
Puttymoon inhabitant
|
Somebody does something that has animated background and explosions... mmmm, MMMM!!!
|
17 January 2016, 22:52 | #13 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
i never found AMAL that useful, personally... at least not for animations... in Puzcat i used it for sound effects!
|
17 March 2016, 23:33 | #14 |
Registered User
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
|
I thought the only sound related command in AMAL was VUmeter ?
Isn't that more "visual"? Just curious |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A fantastic 2D animating tool/Kickstarter | Adrian Browne | News | 4 | 02 April 2012 00:09 |
Kickstarter for 2D animating tool/Natami | Adrian Browne | Amiga scene | 4 | 30 March 2012 22:45 |
jAMAL - AMOS BASIC AMAL reimplementation in Java! | Mequa | News | 26 | 31 January 2012 02:12 |
Fake member explosion? | pmc | project.EAB | 36 | 30 January 2012 14:08 |
|
|