For a line add a sprite and make it's origin to it's left/center.
To make the line between two objects:
1. set the line's position to the first object.
2. set the line's angle toward the second object.
3. set the line's width to the distance between the two objects.
EDIT:
And yes you can use the canvas plugin to draw a curve (a line as well if you want).
http://dl.dropbox.com/u/5426011/examples16/canvas_curve.capx
made with r110.2
The canvas plugin wraps much of the html5 canvas so you can use javascript examples as a guide.
https://developer.mozilla.org/en-US/docs/Canvas_tutorial/Drawing_shapes
A loop is unavoidable. You could unroll the loop and make more events to check each letter of the text but you would have to repeat the events the max number of letters you want to handle. The end result would be a bunch of repetitive events that are hard to maintain, only handle a maximum number of letter, and would likely end up performing the same.
This should behave the same as your events:
+for each BuildingFamily +System: TowerSmall.X-Basket.X <= 300 +BuildingFamily: Number = TowerSmall.Number -> BuildingFamily: Fade: start fade
The "for each" would not be needed if there was only one instance of TowerSmall.
Set the deceleration of the player sprite to zero, and add an event to set the "platform vector X" to 0 when the player lands. That should make it more accurate.
I divided by 60 in the expressions assuming a constant 60fps. In reality the framerate varies so the exact path can't be found.
Yes, boids, they are used for simulating flocks of birds or movement of groups.
Here is my reference:
http://www.kfish.org/boids/pseudocode.html
First attempt:
I basically used the same format as the ref. I think I made a math typo in it somewhere, it's a bit unstable in spots.
https://www.dropbox.com/s/lyolk1o1lzap0 ... .capx?dl=0
2nd:
This is a rewrite from scratch in a typical event fashion. Only eight events and I seem to have fixed the math so its a bit more stable.
https://www.dropbox.com/s/oaybpue9w88yd ... .capx?dl=0
3rd:
This rewrite is based on the idea that it would be cool if vector math could be done directly and not have to do the formulas with the components of the vectors. The result was a lot of the math was hidden in a bunch of reusable vector functions. All the function.calls in the expression kind of counteracted the simplifying of expressions I was going for. Not to mention that it's a bit more tedious writing expressions with my system because errors are just ignored.
https://www.dropbox.com/s/rpqmyaypsxo4u ... .capx?dl=0
When colliding the amount the two objects overlap will vary.
One solution would be to back out of the obstacle until not colliding and then turn and moving by the amount backed out.
http://dl.dropbox.com/u/5426011/examples15/train.capx
You could use a separate object for the slope and make it solid. Then detect when the player is on the slope with "player is overlapping slope an offset (0,1)" and move the player off the slope with "player: set x to player.X+1" to make it slide.
Ok, I fixed that bug and tweaked it a bit. Re-download from first post.
Develop games in your browser. Powerful, performant & highly capable.
You do not have permission to view this post
It won't work on the base layer since it doesn't have any transparency, but if you add another layer it should work.
It's working for me on two different computers, Firefox and Chrome.
What is it that isn't working? Does the sprite draw with no outline or does the game not load?
Does the sprite you apply it to have any transparency? The outline is applied between transparent and opaque pixels, but it doesn't draw beyond the sprites quad so a solid color sprite will have no visible outline.
I did something similar to what you're describing for a top view game:
http://www.scirra.com/forum/roguelike-map-system-untiled_topic51967_post327292.html?KW=capx+rooms#327292
This works.
Set Text to tokenat(replace("1,2,3,4,5,", Text.Text & ",", ""),int(random(4)), ",")
#This is how you save a object refrence
System.Create("Sprite", 1, 200,200)
RefToFirstSprite = SOL.Sprite[0]
#Then you can destroy it later like so.
RefToFirstSprite.Destroy()
You could use the listbox object it specializes in a scrolling list of text.
If you still want to implement it yourself with events here is a example:
http://dl.dropbox.com/u/5426011/examples15/scrollbar.cap
Here are a few other examples of a scrollbar widgit:
http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=5343
http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=3809
and here is a uncommented cap of an advanced scrollbar.
http://www.scirra.com/forum/utility-2d-array-editor_topic41701.html