Log In  



Hello erreybuddy. I don't have a specific project I'm working on or anything, but it's been bothering me that I don't understand how this works. I do have a pixel that oscillates properly, but I do not understand my own code, so I don't know how to approach having the pixel start at a different point in the oscillation cycle, without the amplitude changing. Here's my current code.

function _update()
    y = sin((f)/100) * 8 +64

function _draw()

If any smarty-pantses could explain why this code works to me like I'm a child, or how to have the pixel start at another point along the wave without changing amplitude (the x and y values of the top and bottom of its current pattern of movement), that'd be great.

I do feel bad asking for something without contributing to the community. Hopefully someday I can give back a little. Thank you all.

P#46323 2017-11-15 14:44 ( Edited 2017-11-15 20:03)

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-10-15 12:41 | 0.060s | 2097k | Q:10