Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 Animation

View previous topic View next topic Go down 
AuthorMessage
papydall

avatar

Number of posts : 39
Age : 66
Localisation : TUNISIA
Registration date : 2013-03-16

PostSubject: Animation   Wed Dec 09, 2015 9:01 pm

Hello everybody


Code:

rem ============================================================================
rem         A N I M A T I O N
rem           BY PAPYDALL
rem ============================================================================

Init()
Anim()

END
REM ============================================================================
SUB Init()
    dim p,xh ,xc,xr,xs, x,y,x1,x3,xfr,v
    full_space 0 : picture 10 : full_space 10 : width 10,920 : height 10,600
    top 10,(height(0) - height(10))/2 : left 10,(width(0) - width(10))/2
    color 10,0,255,255 : 2d_target_is 10 : print_target_is 10 : hide 10
    font_color 10,255,0,0 : font_bold 10 : font_size 10,8
    caption 0,"<CLICK> TO STOP ...."
    v = 10 : ' Speed of the movement of machines to be modified
    image 20
    alpha 30 : top 30,50 : left 30,width(0)/2 - 200 : font_bold 30
    font_name 30,"tahoma" : font_size 30,14
     caption 30,"ANIMATION BY PAPYDALL" + chr$(13) + "     <CLICK> TO STOP "
END_SUB
REM ============================================================================
SUB Anim()
    while "papydall" <> "PAPYDALL"
        Landscap()
        Building()
        Fred_House()
        Panoramic()
        Rita_Shop()
        Scool_Car()
        Papydall()
        Sidney_Car()
        MR()
        Ambulance()
        Trains()
        Snow_Man()
        image_recopy()
        if scancode <> 0 then Bye()
   end_while
END_SUB
REM ============================================================================
SUB Landscap()
    2d_fill_on : 2d_fill_color 000,255,255 : 2d_rectangle 0,0,920,600
    2d_fill_on : 2d_fill_color 220,220,255 : 2d_rectangle 0,300,920,600
    2d_pen_color 220,220,220
    2d_circle 000,300,150 : 2d_circle 050,300,170 : 2d_circle 100,300,090
    2d_circle 200,300,050 : 2d_circle 230,300,100 : 2d_circle 300,300,060
    2d_circle 430,300,120 : 2d_circle 500,300,060 : 2d_circle 630,300,090
    2d_circle 700,300,070 : 2d_circle 770,300,070 : 2d_circle 850,300,050
    2d_circle 880,300,040
    2d_fill_color 128,128,128 : 2d_rectangle 0,350,920,400
END_SUB
REM ============================================================================
SUB Building()

    2d_fill_color 164,164,164
    2d_pen_color 164,164,164 : 2d_rectangle 500,70,600,320

    2d_fill_color 0,0,128 : 2d_pen_color 0,0,128
    For x = 510 to 570 step 30
        For y = 80 to 290 step 30 : 2d_rectangle x,y,x+20,y+20 : next y
    next x
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_rectangle 570,260,590,320
END_SUB
REM ============================================================================
SUB Fred_House()

    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 700,250,800,350
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_rectangle 740,300,765,350
    2d_fill_color 128,0,0 : 2d_pen_color 128,0,0
    2d_rectangle 775,200,800,250
    if p = 1 then xh = 1
    if xh > 50 then xh = 1
    xh = xh + 2.5
    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 700,250,800,350
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_rectangle 740,300,765,350
    2d_fill_color 128,0,0 : 2d_pen_color 128,0,0
    2d_rectangle 775,200,800,250
    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_circle 785,195-xh,5    : 2d_circle 800,195-xh,4
    2d_circle 790,195-xh,3    : 2d_circle 780,195-xh,2
END_SUB
REM ============================================================================
SUB Panoramic()
    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_Rectangle 0,240,150,340
    2d_fill_color 0,0,255 : 2d_pen_color 0,0,255
    2d_Rectangle 20,280,90,330
    2d_fill_color 255,102,0 : 2d_pen_color 255,102,0
    2d_Rectangle 110,270,130,330
    2d_fill_color 0,255,0 : 2d_pen_color 0,255,0
    2d_rectangle 20,220,105,240
    2d_fill_color 0,255,0 : 2d_pen_color 255,255,0
    2d_rectangle 103,220,143,240
    2d_fill_color 0,255,0
    print_locate 20,220 : print "  Panoramic's bar  "
END_SUB
REM ============================================================================
SUB Rita_Shop()
    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_Rectangle 170,240,320,340
    2d_fill_color 0,0,255 : 2d_pen_color 0,0,255
    2d_Rectangle 190,280,260,330
    2d_fill_color 255,102,0 : 2d_pen_color 255,102,0
    2d_Rectangle 270,280,290,340
    2d_fill_color 0,255,0 : 2d_pen_color 0,255,0
    2d_rectangle 180,220,310,240

    print_locate 190,220 : print " Rita's Deals"
    print_locate 205,245 : print "Cupcakes"

END_SUB
REM ============================================================================
SUB Papydall()

    if p = 1 then xc = 100
    xc = xc +  .5*v
    if xc > 1000 then xc = 0
    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 910-xc,270+y,970-xc,290+y
    2d_rectangle 930-xc,230+y,1090-xc,290+y

    2d_fill_color 0,128,128 : 2d_pen_color 0,128,128
    2d_rectangle 935-xc,250+y,1075-xc,270+y

    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    print_locate 970-xc,230+y : print "Papydall "
    2d_circle 925-xc,290+y,10 : 2d_circle 1050-xc,290+y,10

    2d_fill_color 128,128,0   : 2d_pen_color 128,128,0
    2d_circle 980-xc,260+y,5  : 2d_circle 970-xc,260+y,5
    2d_circle 990-xc,260+y,5  : 2d_circle 1000-xc,260+y,5
    2d_circle 1010-xc,260+y,5 : 2d_circle 1030-xc,260+y,5
    2d_circle 945-xc,260+y,5

    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
END_SUB
rem ============================================================================

SUB Scool_Car()
    if p = 1 then xr = 0
    xr = xr +  1*v
    if xr > 1000 then x = 0
    y = 60
    2d_fill_color 255,255,0 : 2d_pen_color 255,255,0
    2d_rectangle 910-xr,270+y,970-xr,290+y
    2d_rectangle 930-xr,230+y,1000-xr,290+y

    print_locate 935-xr,230+y : print "Scool"
    2d_fill_color 0,128,128 : 2d_pen_color 0,128,128
    2d_rectangle 935-xr,250+y,995-xr,270+y
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 925-xr,290+y,10 : 2d_circle 990-xr,290+y,10
END_SUB
REM ============================================================================
SUB Sidney_Car()
    if p = 1 then x1 = 0
    x1 = x1 +  1.5*v
    if x1 > 1200 then x1 = 0
    2d_fill_color 0,0,128 : 2d_pen_color 0,0,128
    2d_rectangle 910-x1,270+y,970-x1,290+y
    2d_rectangle 930-x1,260+y,970-x1,280+y
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 925-x1,290+y,10 : 2d_circle 955-x1,290+y,10
END_SUB
REM ============================================================================
SUB MR()
    if p = 1 then x3 = 90
    x3 = x3 + 1.1*v : y = 60
    if x3 > 1000 then x3 = 0

    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 910-x3,270+y,970-x3,290+y
    2d_rectangle 930-x3,230+y,1000-x3,290+y

    2d_fill_color 0,128,128 : 2d_pen_color 0,128,128
    2d_rectangle 935-x3,250+y,995-x3,270+y

    2d_fill_color 255,255,0 : 2d_pen_color 255,255,0
    print_locate 935-x3,230+y : print "  MR 123 "
    2d_circle 925-x3,290+y,10 : 2d_circle 990-x3,290+y,10
END_SUB
REM ============================================================================
SUB Snow_Man()
    y = 200
    2d_fill_color 255,255,255 : 2d_pen_color 255,255,255
    2d_circle 100,230+y,50 : 2d_circle 100,150+y,45 : 2d_circle 100,70+y,40
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0 : 2d_circle 90,60+y,5
    if sin(p/150) < .98 then 2d_circle 110,60+y,5
    2d_circle 100,85+y,5 : 2d_circle 110,85+y,5 : 2d_circle 90,85+y,5
    2d_circle 80,80+y,5 : 2d_circle 120,80+y,5

    2d_fill_color 255,255,255
    print_locate 75,145+y : print "HELLO"
    print_locate 70,225+y  : print "EVERY ONE"
END_SUB
REM ============================================================================
SUB Trains()
    if p = 1 then xfr = 0
    xfr = xfr + 1*v
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    if xfr > 1000 then xfr = -200
    2d_rectangle 10+xfr,280,40+xfr,340
    2d_fill_color 255,102,0 : 2d_pen_color 255,102,0
    2d_rectangle 10+xfr,315,130+xfr,365
    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_circle 70+xfr,380,15 : 2d_circle 110+xfr,380,15 : 2d_circle 35+xfr,380,15
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 70+xfr,380,5 : 2d_circle 110+xfr,380,5 : 2d_circle 35+xfr,380,5
    2d_rectangle xfr-30,340,10+xfr,350
    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle xfr-100,315,xfr-25,365
    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_circle xfr-80,380,15 : 2d_circle xfr-40,380,15
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle xfr-80,380,5 : 2d_circle xfr-40,380,5

    if xfr > 250 then x = 0
    2d_rectangle 230+xfr,260,250+xfr,320
    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 210+xfr,315,330+xfr,365

    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 270+xfr,370,15 : 2d_circle 310+xfr,370,15 : 2d_circle 235+xfr,370,15
    2d_fill_color 255,255,0  : 2d_pen_color 255,255,0
    2d_circle 270+xfr,370,5  : 2d_circle 310+xfr,370,5  : 2d_circle 235+xfr,370,5

END_SUB

REM ============================================================================
SUB Ambulance()
    if p = 1 then xs = 200
    y = 65 : xs = xs + 2.5*v
    if xs > 1200 then xs = -250

    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_circle 965-xs,225+y,8

    2d_fill_color 164,164,164 : 2d_pen_color 164,164,164
    2d_rectangle 910-xs,270+y,970-xs,290+y
    2d_rectangle 930-xs,230+y,1000-xs,290+y

    2d_fill_color 0,128,128 : 2d_pen_color 0,128,128
    2d_rectangle 935-xs,250+y,995-xs,270+y

    print_locate 935-xs,230+y : print "Ambulance"
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 925-xs,290+y,10 : 2d_circle 990-xs,290+y,10

    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_circle 650-xs,225+y,10
    2d_fill_color 255,255,255 : 2d_pen_color 255,255,255
    2d_rectangle 610-xs,270+y,670-xs,290+y
    2d_rectangle 630-xs,230+y,700-xs,290+y
    2d_fill_color 255,0,0 : 2d_pen_color 255,0,0
    2d_rectangle 650-xs,250+y,680-xs,260+y

    2d_rectangle 660-xs,240+y,670-xs,270+y
    2d_fill_color 0,0,0 : 2d_pen_color 0,0,0
    2d_circle 625-xs,290+y,10 : 2d_circle 690-xs,290+y,10

END_SUB
REM ============================================================================
sub image_recopy()
   2d_target_is 10 : 2d_image_copy 20,0,0,width(10),height(10)
   2d_target_is 0  : 2d_image_paste 20,left(10),top(10)
   2d_target_is 10
end_sub
rem ============================================================================
SUB Bye()
    dim_local i,h
    h = height(0)
    caption 30,"See you again soon !"
    for i = h to 10 step -10
        height 0,i : pause 50
    next i
    terminate
END_SUB
rem ============================================================================



sunny sunny sunny sunny sunny
Back to top Go down
View user profile
 
Animation
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Animation Importing, Setup, etc. Tutorial
» Long Chieng (Looj Ceeb)
» Remove first boot animation
» Shigeo Kageyama Vs Akira Animation

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: