Create blink screen effect as in the following example.

Hi all! Today is my third day with corona and I’m already creating a brand new game! 

I want to create a blink effect when my character is reached by a ball. I’ve found the effect I want to make in the following app: 

http://youtu.be/fhfQMheBhJo in the second 14 when the player loses there is a blink on the screen, I want to create something similar in corona, but I’ve no idea how to achieve it? 

Can someone give me an idea/place to read/ book to read where I can find how to do this? 

I’ve a background in server development so I’m kind of lost when creating all this effects…

Thanks a log in advance!

This is really simple to do in Corona. You need to create a white rectangle with blendMode = “add”. Then just use transition.fadeIn() and transition.fadeOut() … something like this (may not be valid lua code, I’m just writing it off the top of my head :slight_smile:

local rect = display.newRect(0, 0, 500, 400) rect:setFillColor(1) rect.blendMode = "add" rect.alpha = 0 transition.fadeIn(rect, {time = 200, onComplete = function() transition.fadeOut(rect, {time = 200}) end})

Awesome!! Thanks it works perfectly!

Thanks!!!

This is really simple to do in Corona. You need to create a white rectangle with blendMode = “add”. Then just use transition.fadeIn() and transition.fadeOut() … something like this (may not be valid lua code, I’m just writing it off the top of my head :slight_smile:

local rect = display.newRect(0, 0, 500, 400) rect:setFillColor(1) rect.blendMode = "add" rect.alpha = 0 transition.fadeIn(rect, {time = 200, onComplete = function() transition.fadeOut(rect, {time = 200}) end})

Awesome!! Thanks it works perfectly!

Thanks!!!