Log In  


Cart #34135 | 2016-12-25 | Code ▽ | Embed ▽ | No License
59

This sample code shows how to add screenshake. It also shows how to fade an image to black using the palette function.

59


Love the camshake code, so easy to implement and to understand! Thanks man!


Thank you! Used your code for screen shake.


1

Thanks! I used the screen shake code.
I credited you in the source code~


1

I know this is old, but THANK YOU!


Also, thank you.


Hi,
thanks for this and for all the tutorials! I have been learning a lot and I'm having a great time with pico8!

I have been looking at the black magic line:
kmax=(p+(j*1.46))/22

And I replaced it with the following:
col_st={2,3,3,4,3,4,5,5,5,6,4,4,3,4,5}
kmax=p*col_st[j]/100

col_st contains the number of "steps" that each color has to take to go from the original color to black (0) and it is based on dpal={0,1,1,2,1,13,6,4,4,9,3,13,1,13,14}
Steps is inaccurate since the original color is counted so it is more like the states one color goes through, if this makes any sense :)
For exemple color 2 goes to 0 as follows: 2->1->0

now this:
kmax=p*col_st[j]/100
p/100 is our % fadeout, multiplied by col_st gives us the state we want this color to be

so with color 2 we have no change up to 33% fadeout, then it changes to color 1 up to 66% and after 66% it becomes black.

What do you think? Does this make any sense?

Bye!


I used this for my torpedoes for my SHMUP! I'm using LazyDevs...

I credited you in the SC



[Please log in to post a comment]