About the screen refresh, don't forget the optional parameters of platform.window:invalidate()
( platform.window:invalidate([x, y, width, height]) )
That refreshed only the part of the screen you want ;)
Well, I'm developing a game (not saying the name :p) and the extra parameters are really important for me. Now I don't need to redraw all the images on the screen using gc:drawImage (which is slow), and I notice a big speedup. The game will be unplayable without it.
Well, the thing is that I don't have to draw more images if I use this. Redrawing the screen alone might be faster, but for many games that need images, the combination will be faster. drawImage really can be a bottleneck in programs, and that is why I try to limit using it with redrawing only parts.
Currently sound isn't the most easy thing to do. It is possible, but requires lots of programming work and possibly some hardware work (like adding a resistor after the output).
The speed is 115200 baud.
I'll try to make a little example soon :)
I don't think its the quantity of levels that counts, but the quality ;)Lol, ok :D
I'll already be happy if there are just a few :)
Yeah it would be niceErrr I have no idea. Sorry :(
Btw for some reasons the game is very slow on my CX compared to the original. Like about 3x slower it seems. Is it normal?
How work the path of the monsters ?Yeah, it is. :)
Is it random ?
Pianoman, a tip to speed it up: change the white in the sprites with alpha (if you don't do this aready)Wait, what? :P
He means make the white on the backgrounds transparent.Yeah, I think I can do a blue glow... :)
If possibru, can you add a blue glow? Like the retro? :3
Contrary to popular belief, the movements for three of the ghost are not random, except for the red one! I think it's on Google somewhere. Try googling "Pathways of the PacMan ghosts"
Contrary to popular belief, the movements for three of the ghost are not random, except for the red one! I think it's on Google somewhere. Try googling "Pathways of the PacMan ghosts"The red one is actually the one that's the most predictable. :)
Pianoman, a tip to speed it up: change the white in the sprites with alpha (if you don't do this aready)Wait, what? :P
Do you draw them with geometric primitives?
function drawghosts(gc)
gc:setColorRGB(255,0,0)
gc:fillArc(gonex,goney,blockwidth,blockwidth,0,180)
gc:fillPolygon({gonex,goney+blockwidth/2,gonex,goney+blockwidth,gonex+.2*blockwidth,goney+.8*blockwidth,gonex+.4*blockwidth,goney+blockwidth,gonex+.45*blockwidth,goney+blockwidth,gonex+.45*blockwidth,goney+.8*blockwidth,gonex+.55*blockwidth,goney+.8*blockwidth,gonex+.55*blockwidth,goney+blockwidth,gonex+.6*blockwidth,goney+blockwidth,gonex+.8*blockwidth,goney+.8*blockwidth,gonex+blockwidth,goney+blockwidth,gonex+blockwidth,goney+.5*blockwidth,gonex,goney+.5*blockwidth})
gc:setColorRGB(255,255,255)
gc:fillArc(gonex+.25*blockwidth,goney+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:fillArc(gonex+.6*blockwidth,goney+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:setColorRGB(0,0,255)
gc:fillArc(gonex+.38*blockwidth,goney+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
gc:fillArc(gonex+.75*blockwidth,goney+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
gc:setColorRGB(0,255,255)
gc:fillArc(gtwox,gtwoy,blockwidth,blockwidth,0,180)
gc:fillPolygon({gtwox,gtwoy+blockwidth/2,gtwox,gtwoy+blockwidth,gtwox+.2*blockwidth,gtwoy+.8*blockwidth,gtwox+.4*blockwidth,gtwoy+blockwidth,gtwox+.45*blockwidth,gtwoy+blockwidth,gtwox+.45*blockwidth,gtwoy+.8*blockwidth,gtwox+.55*blockwidth,gtwoy+.8*blockwidth,gtwox+.55*blockwidth,gtwoy+blockwidth,gtwox+.6*blockwidth,gtwoy+blockwidth,gtwox+.8*blockwidth,gtwoy+.8*blockwidth,gtwox+blockwidth,gtwoy+blockwidth,gtwox+blockwidth,gtwoy+.5*blockwidth,gtwox,gtwoy+.5*blockwidth})
gc:setColorRGB(255,255,255)
gc:fillArc(gtwox+.25*blockwidth,gtwoy+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:fillArc(gtwox+.6*blockwidth,gtwoy+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:setColorRGB(0,0,255)
gc:fillArc(gtwox+.38*blockwidth,gtwoy+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
gc:fillArc(gtwox+.75*blockwidth,gtwoy+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
gc:setColorRGB(255,128,255)
gc:fillArc(gthreex,gthreey,blockwidth,blockwidth,0,180)
gc:fillPolygon({gthreex,gthreey+blockwidth/2,gthreex,gthreey+blockwidth,gthreex+.2*blockwidth,gthreey+.8*blockwidth,gthreex+.4*blockwidth,gthreey+blockwidth,gthreex+.45*blockwidth,gthreey+blockwidth,gthreex+.45*blockwidth,gthreey+.8*blockwidth,gthreex+.55*blockwidth,gthreey+.8*blockwidth,gthreex+.55*blockwidth,gthreey+blockwidth,gthreex+.6*blockwidth,gthreey+blockwidth,gthreex+.8*blockwidth,gthreey+.8*blockwidth,gthreex+blockwidth,gthreey+blockwidth,gthreex+blockwidth,gthreey+.5*blockwidth,gthreex,gthreey+.5*blockwidth})
gc:setColorRGB(255,255,255)
gc:fillArc(gthreex+.25*blockwidth,gthreey+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:fillArc(gthreex+.6*blockwidth,gthreey+.25*blockwidth,.25*blockwidth,.35*blockwidth,0,360)
gc:setColorRGB(0,0,255)
gc:fillArc(gthreex+.38*blockwidth,gthreey+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
gc:fillArc(gthreex+.75*blockwidth,gthreey+.35*blockwidth,.1*blockwidth,.15*blockwidth,0,360)
end
Hmmm, that's interesting... I'll try that. :)
However, looking at what the final shape of the ghost looks like, I think I would have done the drawing differently :
- draw the top semi-circle
- draw a square under it, for the bottom part,
- draw white triangles at the very bottom
^ that's all
+the eyes :)
However, looking at what the final shape of the ghost looks like, I think I would have done the drawing differently :
- draw the top semi-circle
- draw a square under it, for the bottom part,
- draw white triangles at the very bottom
^ that's all