[Behavior] Zigzag Forum Home > Construct 2 Development > Plugins for Construct 2 |
Post Reply
|
Page 123> |
| Author | |
Post Options
Quote Reply
Topic: [Behavior] ZigzagPosted: 19 Nov 2011 at 12:51am |
|
|
Zigzag
(icon is made by gonzdevour) (Update: 2012/03/12) Using LOGO-like script to move/rotate sprite. Currently, zigzag provides 5 commands. - Move (F)orward. (ex: "F 100" means move the spsrite forward 100 pixels.) - Move (B)ack - Turn (L)eft (ex: "L 60" means rotate the spsrite left 60 degrees.) - Turn (R)ight - (W)ait (ex: "W 1" means do nothing, just wait 1 second.) The format of one command is "F/B/L/R/W #". ex: "F 100","B 100","L 60","R 60","W 0.5" You can use a sequence of commands to describe the moving path. ";" is used to join commands. ex: "F 100;R 60" Zigzag also provides repeat count setting. If repeat count = 0 means repeat infinity. So combining command sting "F 100;R 60" with repeat infinity, you can image the sprite will move through a hex path repeatly. Here is an example - Zigzag uses as moving path of bullet ![]() - Zigzag uses as moving path of platform object ![]() Or, zigzag can be used to describe the moving path of an enemy, or the moving path of laser (combine with step behavior). Basically, zigzag can wok well without adding any event. It still has some conditions/actions. - Condition: On command queue finish - Condition: On command start - Condition: On command finish - Action: Set activated - Action: Execution start - Action: Execution stop - Action: Clean command queue - Action: Add command The different between "Activated" and "Start" is -- "Activated" is more likely to "pause". [Advance] You can assign speed at command string by adding "[max,acc,dec]" after a command. ex: "F 100 [200,0,0]; R 60; F 100 [100,0,0]; R 60" - F 100 [200,0,0] -> using max speed =200, acc = 0, dec = 0 to execute command "F 100" - F 100 [100,0,0] -> using max speed =100, acc = 0, dec = 0 to execute command "F 100" The speed setting is used javascript's "eval" to get the array, so that you can use "[100+100*Math.random(),0,0]" to assign speed. -- Yes, this is another plugin for lazy guy like me. Edited by rexrainbow - 12 Feb 2013 at 4:39pm |
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 1:38am |
|
|
Thankyou for this.
P.S. I'm lazy too.....! Edited by tonycrew - 19 Nov 2011 at 1:39am |
|
|
http://dl.dropbox.com/u/44766364/Games/Space2011/index.html Space 2011 (C2 Competition Entry
http://dl.dropbox.com/u/44766364/Games/getin/index.html Get That Ball In (C2 Game) |
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 7:44am |
|
|
You've made some pretty awesome contributions to C2, you know that? :D
|
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 8:24am |
|
|
I'm glad that you like it.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 8:37am |
|
|
Thanks Rexrainbow this is just what I needed. This ones a great time saver.
I agree you do make some pretty awesome contributions. My Construct 2 plugins, and behaviors folders are full of rex_folders.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 4:49pm |
|
|
very nice sir,
you've pretty much automated enemy patrols for a lot of people. well done. |
|
![]() |
|
Post Options
Quote Reply
Posted: 19 Nov 2011 at 5:25pm |
|
|
Oh, this looks like it could be quite useful for my current project. Well done, man!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 23 Jan 2012 at 3:53pm |
|
|
Great !
One more time! Lets Drink a beer to comemorate your presence here! I love U man! Im reading all of your topics / posts of plugins / behaviors u made! Thanks again! |
|
![]() |
|
Post Options
Quote Reply
Posted: 25 Jan 2012 at 8:12am |
|
|
@jardelbr
If you are using zigzag plugin to create laser, try to combine this plugin with step behavior. |
|
![]() |
|
Post Options
Quote Reply
Posted: 28 Jan 2012 at 12:55pm |
|
|
@rexrainbow
Good. for now im not using lasers yet, maybe in future; Thanks again. |
|
![]() |
|
Post Reply
|
Page 123> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |