Sign in to follow this  
Followers 0
Chattah

Pacman Animation Screen Flicker

2 posts in this topic

Hey guys I've been playing with AutoIT now for about a month using it mostly to automate some boring tasks at work. Well recently I have decided to mess around with other aspects of it and here lies my issue.

I'm trying to create an animated pac man that will eventually run around the screen and eat things. I have been unable so far to either reduce or eliminate the flicker that happens when my pac man opens and closes his mouth. Any help would be appreciated.

CODE
#include <GUIConstants.au3>

HotKeySet("{ESC}", "_zExitScript")

GUICreate("Renee1", 600, 600, -1, -1, BitOR($WS_SYSMENU,$WS_POPUPWINDOW,$WS_BORDER,$GUI_ONTOP), $WS_EX_STATICEDGE+$WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$pac_mouth_size = 270; This is the size of the mouth

$pac_mouth_angle = 30; This is the angle the mouth starts at reduce this for proper effect

Do

GUISetState(@SW_SHOW)

Sleep(100)

GuiCtrlCreateGraphic(220, 10)

GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0, 0xFFFF00)

GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 30,$pac_mouth_angle,$pac_mouth_size)

GUICtrlSetState(-1, $GUI_GR_REFRESH)

$pac_mouth_size = $pac_mouth_size + 4

$pac_mouth_angle = $pac_mouth_angle - 2

Until $pac_mouth_size >= 350

Do

GUISetState(@SW_SHOW)

Sleep(100)

GuiCtrlCreateGraphic(220, 10)

GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0, 0xFFFF00)

GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 30,$pac_mouth_angle,$pac_mouth_size)

GUICtrlSetState(-1, $GUI_GR_REFRESH)

$pac_mouth_size = $pac_mouth_size - 4

$pac_mouth_angle = $pac_mouth_angle + 2

Until $pac_mouth_size <= 270

While 1

Sleep(100)

WEnd

Func _zExitScript()

Exit

EndFunc

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0