Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #SingleInstance,force
- #Include,<gdip>
- SetBatchLines, -1
- time_time_time := 250
- global width:=[]
- width[1]:=30
- mass_x:=[]
- mass_y:=[]
- global mass_x:=[2,3,4,5,6,7,8,9,10]
- global mass_y:=[2,2,2,2,2,2,2,2,2]
- pToken := Gdip_Startup()
- global game:={h:650,w:500,x:400,y:10}
- gui,1: -caption +lastfound -dpiscale +E0x80000 +AlwaysOnTop
- GUI,1:Show,% "x" game.x " y" game.y " w" game.w " h" game.h
- global hwndl:=WinExist()
- hbm := CreateDIBSection(game.w, game.h)
- global hdc:=CreateCompatibleDC()
- obm:=SelectObject(hdc,hbm )
- global G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- global pbrush1:=Gdip_BrushCreateSolid("0xffaf0c0b")
- global pbrush2:=Gdip_BrushCreateSolid("0xff00ff00")
- global pbrush3:=Gdip_BrushCreateSolid("0xff0000ff")
- global pbrush4:=Gdip_BrushCreateSolid("0x00ffffff")
- global pbrush5:=Gdip_BrushCreateSolid("0xffffffff")
- global pbrush6:=Gdip_BrushCreateSolid("0xff0c00b0")
- global pbrush7:=Gdip_BrushCreateSolid("0xff000000")
- ;~ pPen1 := Gdip_CreatePenFromBrush(pBrush1, 5)
- ;~ pPen2 := Gdip_CreatePenFromBrush(pBrush7, 1)
- ;~ pPen3 := Gdip_CreatePenFromBrush(pBrush7, 3)
- Gdip_FillRectangle(g, pBrush7, 0, 0, game.w, game.h)
- UpdateLayeredWindow(hwndl, hdc, game.x, game.y, game.w, game.h)
- ;~ SetTimer,main_loop,1000
- gosub main_loop
- return
- main_loop:
- move_chain(mass_x.MaxIndex())
- return
- ; check odd ; if returns true it's an odd number like 1,3 ,,7 so on, if false it's an even number , for instance: 2,4,6.. (2018 as well)
- ch_odd(x){
- if(mod(x,2) == 1)
- return true
- return false
- }
- ; function create an array that is used while showing pictures , to show all the motion of telepostation you need to execute as many steps as this massive has, and
- ; every element of the array shows from what element you must start showing ellements and function show_right_odd(even - difference only in the number in terms of "oddness" &
- ; "evenness" ) shows where you have to stop (actually programme have, not you ,but never mind )
- ; as it's gpid version. we don't need to use hide functions as we just create everything on the screen from the ashes, from the very beginning, I hope you understand what i'm trying
- ; to say
- Show_Left_ODD(byref mass,x){
- mass:=[]
- loop % (x-1)/2 {
- mass.insert(1)
- mass.insert(2)
- }
- t:=0
- loop % x {
- t++
- mass.insert(t)
- }
- mass.insert(0)
- }
- Show_Right_ODD(byref mass,x){
- mass:=[]
- t:=0
- loop % x {
- t++
- mass.insert(t)
- }
- loop % (x-1)/2 {
- mass.insert(x-1)
- mass.insert(x)
- }
- mass.insert(0)
- }
- Show_Left_EVEN(byref mass,x){
- mass:=[]
- loop % (x-2)/2 {
- mass.insert(1)
- mass.insert(2)
- }
- t:=0
- loop % x {
- t++
- mass.insert(t)
- }
- mass.insert(0)
- }
- Show_Right_EVEN(byref mass,x){
- mass:=[]
- t:=0
- loop % x {
- t++
- mass.insert(t)
- }
- loop % (x-2)/2 {
- mass.insert(x-1)
- mass.insert(x)
- }
- mass.insert(0)
- }
- ;**************************************************************************************************************\
- ;**************************************************************************************************************
- ;**************************************************************************************************************
- move_chain(x){
- global time_time_time
- mass_S_L:=[]
- mass_S_R:=[]
- if(ch_odd(x)){
- Show_Left_ODD( mass_S_L,x)
- Show_right_ODD( mass_S_R,x)
- }
- else{
- Show_Left_EVEN( mass_S_L,x)
- Show_right_EVEN( mass_S_R,x)
- }
- QUA:=mass_S_L.MaxIndex()
- t:=0
- loop %qua% {
- Sleep time_time_time
- t++
- ;~ Gdip_FillRectangle(g, pBrush7, 0, 0, game.w, game.h)
- ;show - draw
- a:=mass_S_L[t]
- i:=a
- b:=mass_S_R[t]
- while( a<>0 and i<=b ) {
- ;~ GuiControl,show,chain%i%
- draw_a_piece_of_the_chain(i,t)
- i+=2
- }
- UpdateLayeredWindow(hwndl, hdc)
- }
- }
- draw_a_piece_of_the_chain(i,what){
- ToolTip,% i
- w:=width[1]
- x:=mass_x[i] * w
- y:=(mass_y[i] + what) * w
- Gdip_FillRectangle(g, pBrush5, x, y, w, w)
- }
- x::
- Gdip_Shutdown(pToken)
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement