Log In  
Follow
adge
Follow

Does anybody know what's the easiest way to add a tail to a moving pixel?
A pixel is moving one px to the right but instead of just moving it there should stay a pixel in the pixels first location for a short time. Imagine a fade out.

Is there an easy way to accomplish this?

P#30667 2016-10-11 13:06 ( Edited 2016-10-19 17:01)

Another update, I should probably do less but I'm bad at scheduling.

Cart #31827 | 2016-10-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

NEW CONTROLS:

UP, DOWN --> Rotate
X,C --> Zoom
LEFT,RIGHT --> Particle Size
X&Z --> Effect ON/OFF

The effect is a bit wanky because it makes Z sorting kinda useless --> particles/region increases the deeper they get so they "overdraw" the trails of the ones that are above and more towards you.
This is not my effect, I took it from
NuSan's Trails example
I hope thats ok.

I would like to make a better effect but I'm kinda bad at stuff like that. tyroney already showed me another way which you can see here:
Tyroney's pixel tail
Sadly its a bit computation heavy, maybe I will find a way to use it.

I made the velocity of the particles on the y axis increase the lower they get. z is coming out of the screen, x is to the right.

I'm probably going to implement a function that lets you choose how many particles you want to use.

Future:
What I would like to do is to get away from geometry and make all this happen using physics. Gravitation wouldn't be the problem, Hydrodynamics will be :(
Optimizations regarding particles/region. Draw less when there are more in one place. Maybe only draw the ones that you can actually see but this would get extremely complicated I guess.
I should create a function that takes 4 different vortex states with an offset of 3 or 4 cycles between them, then draw a shape over these 4 coordinates. This way I could create a tail and could overcome some problems but it seems complicated too.

ATTENTION!
If you stare for too long, you will loose connection to the world.

HISTORY OF VORTEX (Old stuff)
Hey humans,

this is an update for the "water swirl"

Cart #31769 | 2016-10-25 | Code ▽ | Embed ▽ | No License
6

I wanted to make it a water swirl/vortex but it ended up looking more like stars getting sucked into a black hole.
It's just like a procedurally generated geometry based animation.
Rotate with up, down, zoom with x,c.

If anyone knows how I could make it look more like this or if someone got ideas/suggestions,
Water swirl simulation
then feel free to tell me.

I was thinking about maybe embedding the swirl into pixel art. I don't really have any use for it.

I just like swirls. They're magic.

Even older

Cart #30634 | 2016-10-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hi there,
this is the second version. Its now infinite, i guess.
I added colors but I'm not to happy about how the colors are selected. It's still too strict there needs to be more fuzzyness about the color selection.
Sadly the more I'm adding the more I have to drop down the number of nodes.
Yellow ones are hit by sunlight...

Controls:
Up, Down: Rotate around X-Axis
X, C (X, Z wtf I don't know which keyboard layout you have): Zoom

if you zoom out a little bit you could imagine a happy tiny little vortex :]

Still todo:
Do some sorting
Make it look better
Maybe an tale like effect for every point. (Does anybody know how to do this?)

Maybe fully switch to fluid dynamics, Pico8 would explode :D

1840

Cart #30586 | 2016-10-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hey guys,

this is just a simple project I started to make. In the end this should look like a vortex as you would expect it in water. White pixels at the top blue and darker blue ones deep down.

It's fully 3D but you can't rotate it while it's animating. There is a variable called Vortex_Animation. Turn it to false and you can rotate this thing with the arrow keys.

I have created a 3D surface that looks like the one you are seeing and put it in parameter form. This would let me create points with simply 2 parameters (U,V) that are random. I create around 1000 points in a for loop and save them.

In update these points get accessed again and a new position for every point is calculated.

Things i have to do:

  1. delete points when out of sight, create new ones to make it infinite
  2. slow down everything
  3. add some colors
  4. fix bad 3D implementation

I could use some help with points 2 and 4. I don't now how to slow down. I would like it to get processed every second or third update call.
Regarding 4, because of the surfaces geometric formula the shape is drawn laying with wrong rotation. As I'm not used to 3D stuff I don't know how this is done but as it is now I have to rotate every point in place after they were updated because the formulas for X,Y ans Z would again present the vortex at a weird angle using the parameters U and V. And because I am updating the points with the same formulas I again have to rotate them back in place, but maybe I should just stick with it.

Best thing would be to "rotate" the formulas itself so you simply had to fill in U and V. No I have to rerotate everything after calculation of X,Y and Z.
Or to implement a system that rotates everything once and then kinda stays there but..
LITTLE DO I KNOW.

I hope you have fun.

P#30587 2016-10-10 18:14 ( Edited 2016-10-26 19:36)

Hey guys,

I'm wondering if there is an exponential function? I've been trying to build my own but it doesn't quite work so I don't know what to do.

P#30558 2016-10-10 14:46 ( Edited 2016-10-13 01:22)

Hi there!

I'm totally new here but got an idea for a small game. A guy has to stay on a wheel which would start to spin if he's not right above it's center point. So I would need to somehow implement lever rules and I would need to rotate the wheel but I really don't know how to do this.

I already took a look at this but really don't understand the code. The first one seems a bit buggy, the second works fine but I can't find the point where the sprite is assigned to the car table.
https://www.lexaloffle.com/bbs/?tid=2189

so to start I would've thought of something simple like this

function draw_wheel()
spr(0,x,y,...)
------------- (get the rotated sprite and draw it)

function _update()
rotate_wheel(1) (add's one degree of rotation every frame (does not have to be 1°))

function _draw()
draw_wheel()

So in a sentence I want a sprite that get's rotated with ever frame by a certain amount.
Some tips?

P#15224 2015-10-10 11:02 ( Edited 2016-12-05 12:48)

Follow Lexaloffle:        
Generated 2020-11-29 05:27 | 0.106s | 4194k | Q:55