diff --git a/lazarus/platformer/project1.ico b/lazarus/platformer/project1.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/lazarus/platformer/project1.ico differ diff --git a/lazarus/platformer/project1.lpi b/lazarus/platformer/project1.lpi new file mode 100644 index 0000000..3afe492 --- /dev/null +++ b/lazarus/platformer/project1.lpi @@ -0,0 +1,79 @@ + + + + + + + + + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <Icon Value="0"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="LCL"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="project1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/lazarus/platformer/project1.lpr b/lazarus/platformer/project1.lpr new file mode 100644 index 0000000..58c35dc --- /dev/null +++ b/lazarus/platformer/project1.lpr @@ -0,0 +1,21 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, Unit1 + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/lazarus/platformer/project1.res b/lazarus/platformer/project1.res new file mode 100644 index 0000000..e994dfa Binary files /dev/null and b/lazarus/platformer/project1.res differ diff --git a/lazarus/platformer/unit1.lfm b/lazarus/platformer/unit1.lfm new file mode 100644 index 0000000..0cef188 --- /dev/null +++ b/lazarus/platformer/unit1.lfm @@ -0,0 +1,252 @@ +object Form1: TForm1 + Left = 246 + Height = 505 + Top = 237 + Width = 764 + Caption = 'Form1' + ClientHeight = 505 + ClientWidth = 764 + OnCreate = FormCreate + OnKeyDown = FormKeyDown + OnKeyUp = FormKeyUp + OnPaint = FormPaint + LCLVersion = '1.6.2.0' + object Image1: TImage + Left = 145 + Height = 64 + Top = 138 + Width = 135 + AutoSize = True + Picture.Data = { + 1754506F727461626C654E6574776F726B477261706869637B1B000089504E47 + 0D0A1A0A0000000D4948445200000087000000400806000000300A6406000000 + 0473424954080808087C0864880000000970485973000007DC000007DC0162FC + 68E80000001974455874536F667477617265007777772E696E6B73636170652E + 6F72679BEE3C1A00000016744558745469746C6500436172746F6F6E206D6F6E + 73746572737E15073E0000001674455874417574686F720053747564696F4669 + 626F6E61636369CFFEE0B80000008E744558744465736372697074696F6E0043 + 6172746F6F6E206D6F6E7374657273206261736564206F6E207475746F726961 + 6C3A20687474703A2F2F7777772E626C6F672E73706F6F6E6772617068696373 + 2E636F2E756B2F7475746F7269616C732F6D6F6E737465722D63686172616374 + 65722D7365726965732D706172742D312D666C79696E672D6261742D67686F73 + 7477FFECB000000021744558744372656174696F6E2054696D6500323030392D + 30342D30315431393A30303A3433EDD862380000005574455874536F75726365 + 0068747470733A2F2F6F70656E636C69706172742E6F72672F64657461696C2F + 32333639382F636172746F6F6E2D6D6F6E73746572732D62792D73747564696F + 6669626F6E616363692D3233363938575B55DC0000005874455874436F707972 + 6967687400434330205075626C696320446F6D61696E2044656469636174696F + 6E20687474703A2F2F6372656174697665636F6D6D6F6E732E6F72672F707562 + 6C6963646F6D61696E2F7A65726F2F312E302FC6E3BDF9000019284944415478 + 9CED9D79745CC59DEF3F75EFED4DAD96BA5B961759D662CBD8B101C7616CC024 + F04E0861C9233098904CC230C9F0E6E4BD8449722673CE642693933324276778 + C34B38BC212421308464C21AC01E306233B6011BBCB058DE24B5E4965AB6D45A + 7ADFFBDEAAF78796789164C99684FB9D7CFE94AAEAFEEEBDDF5BF5ABDFAFAA1A + E6061B70BB6118DB344D8B6B9A56D4342D6A18C6D3C08A39B2A1D4586918C633 + 9AA645479E57DC308C3780DB01632E0C1073708DFFAE69DAC3D5D5D59ECACA4A + 9710C397544A619AA63A7EFC78D634CDFF6B9AE63F026A0EEC39DF118661DC63 + 18C65D8B172F76EABA2E4E7C66B1582C3B3838989052DE09BC38AB86CC62DB0E + 5DD71F76BBDD372F5CB8D0ADEB3A76BB1D5DD7114220A5C4344D0A8502434343 + B96834FA9C65595F9E457B4A025DD79FF0FBFD37F9FD7EA7DD6EC7300C344D43 + 29856559140A052CCBA2AFAF2F9D4EA79FB32CEB7F00F959B165361A0516699A + B6BDA6A6E64ABFDFEF72B95CB85C2E2A2B2BF1F97C545454E0743A01104260B3 + D90C29E5F262B128A5946FCD924DE73D9AA6FD535555D5DF8C3E33B7DB8DCFE7 + C3EBF552565686CD6603869F99CBE5B23B1C8E95A954EA16A5D473406AA6ED99 + 8D9E639D61182FD6D7D757D9ED76CDE974E2F178A8A8A860B47B3C914422413C + 1E2797CB110C0633B95C6E03F0E12CD87512B5B5B57EBB665FA509B552C12221 + 945B810F259242A8B4926250E8B44A218E74767676CFB63DC0C79D4EE75BF5F5 + F5EEB2B2322A2B2BF1783CA7159252924C26492693E472398AC5A20C068343A6 + 69DE00EC9D4983665A1C37D8EDF6A71A1A1ADC369B0D97CB85CFE7C3E974A294 + 22954A5128140070381CB8DD6E8410C46231E2F138D96C96A3478F1E344DF362 + 40CEB06DDAB2FAFAAB10E26694FA3488D54CFDFE8F81DA8A105BF2A6B9A9A7A7 + 273BD3B6198671A0B1B1F1634EA713AFD78BD7EB4529453A9D269F1F1E35EC76 + 3BE5E5E50821C8E57244A35132990CA669120C06D38542E156A079A68C9A4971 + 6C743A9D8FD6D7D797DB6C36DC6E37555555E8BA4E3E9F27168B6159D6491574 + 5DA7AAAA0A4DD3181818209148D0DFDF9F8944225F059E9E09A3EAEAEA7C36A1 + DF05EA4EA07EF4EFCB9A9A58FB894F50B3B8068FC783AE1B689A4001966992C9 + 6409F7F5D2D6DACABEBDFB90724CAB71044F2A53BBB7B3A7B37D266C04BE5455 + 55F5F0FCF9F3CB3C1E0FF3E7CFC7B22C229108A6699E5450D3347C3E1F0E8703 + CBB2181A1A2293C990CFE7E9EEEE4EE772B93B806767C2A8191187AEEB5FB5D9 + 6CFF5E5F5FEFB6DBED783C1E7C3E1F4208128904E9747A620384C0EFF7635916 + 83838364B3593A3A3ABA2CCB6AE41C662F172F58E04E3BCBFE5108BEA594F200 + 7CFAEAABB96CC3E5D81D0E745D67FEFCF9545656525151816118381C0E8AC522 + A669924AA588C7E30C0D0D914C26D184C6E14307D9FCFC2672B91C8025E0494B + 13FF74F4E8D1AEB3B513D0745D3FDAD4D454E772B9C63EA84824825213DFBEDB + EDA6A2A202A514D16894643249A150A0ABAB2B5D2C16BF6959D66FCEC1266006 + C4A169DA771D0EC7DD757575650E87634C18C56291582C769AF2C73542087C3E + 1F8944824422415F5F5F3A1A8D6E045E3E1B9B9A1A1A6E528AFB813AA7D3C997 + 6FBF9DFAC606CACACA58BE7C39F5F5F5E38EE71391CFE7E9E9E9A1BDBD9DFE70 + 98542ACDEF1E7B4CF587C30221320AF5A3BA60F0DE6D70E69B3D9DEBFC7EFF33 + F3E7CF7757545450595949341A9D5418A3188681D7EBC566B311894448A552A3 + 3D48369FCFFF404AF97FCEC29E31CE451C42D3B47B3D1ECFFF5CB8706199C3E1 + A0BCBC1C9FCF473A9D26994C4EAF3121B0DBEDA452A951DF6387699A574DA78D + 868606A72EB90FC1D7016EFBD2175975E1852C58B080B56BD7326FDEBC69D934 + 1EE9749AFDFBF7D3DEDE4E3C1AE3C1071E18F1A3D45BC2B4FD45E058A0673AED + 1986B1ADB1B1F1AAB2B232CACBCBC9E7F35312C6284208DC6E371E8F8768344A + 2A952297CBD1D7D7974926930F4829FF81B3EC81CF461C02D8A069DAFD555555 + 1FF3FBFD2EA7D3497979391E8F87582C46B1583C1B5B00C69CB0603098C9E7F3 + AB81E054EA3534342CD4152F029FA8A9A9515FFFC63784ABCCC5A73EF529AAAB + ABCFDA9E89C86432ECDAB58BBEBE3E5E7A710BEFECDC89100C29A53EDFD1D5B5 + 738ACD34381C8E030D0D0DEEF2F2F273B2C766B3E1F57A4926936302894422D9 + A1A1A1C352CA6F013B99A648846118078165524A5D29650252D3B4CCC8FF2D20 + 0DA0699A26A5742BA5CA3D1E8F555D5DEDB6D96CC2E17050565636F6D54F47F5 + 1391CFE7492693562814BA5F4AF977672ADFB464C932A5E92F03CB3E73CD67B8 + E2CA2BB9E8A28B58B366CDB8D3E799A4BBBB9BEDDBB773BCE7180FFDF2970821 + B252C95B3BBBBAB69CA9AEA6693F5DB264C9B73C1E8FEE7038CED9162104E5E5 + E5140A0532990CB95C0ED334D5C0C0403A994CEA428894A66969F947EFDACD48 + AC4B4A590668420843D3340BE8108661BCA2EBFA157EBF5F73BBDD4E4DD34EBA + D8043785CD66C366B3A1691ABAAE9F536F712A524A32990C8140206E59D64220 + 3751D90B6A6B175BBAF136507FEB6D5FE0C28B2FE6EAABAF66D1A2453366CF99 + 48A552BCF2CA2B442351EEF9C94F90521685E0C640303899CFE4D475BD6FD9B2 + 65956EB79B139FFBB962B3D9B02C0B2925854201D3344F9C6D9DC4891FF348B8 + 21178944A465596F8EBEFD6AE06AC330EED4757DC3C2850B1D4EA753370C03BB + DD8E1062D6BFC053C966B344A3D15C381CFE3B29E583E395199EA66A6F02ABBF + F297B7B372D52AAEBFFE7ABC5EEF9CDA0A50281478E59557E80F87F9C98F7E8C + 40A4405E15E8EA7A6FBCF29AA6FDAF050B16FCD4E7F3395D2ED79CDAAA944229 + 35269C5C2E67F5F5F5E52DCB7ADB34CD4780D78181F1DE789DAEEBFF62B3D9BE + 505B5BEB1E9DE219C69C2402C7B02C8B6C364B7B7B7B584A59CFE9F903B1ACBE + E159E0E6EB3FF7392EBDFC326EBCF1462A2B2BE7D4CE13314D932D5BB6D0130A + F1D37FBB1714A1BC343FDED3D31339A5A853D3B4AEE5CB97CF773A9D73FE6C4D + D3249FCF639A263D3D3DE962B1F89465593F044227961B2FB712574A6D324D73 + 732291F8B342A1E075381C76CBB2C6926653C1B22C8AC5E2983A0DC39856EFA3 + 691AA66962B3D9ECE9741AA5D4B613FFBFB4A1E13B02BEB36AF56A3E7BDDB55C + 7FFDF5F8FDFE29B73F1B689A46434303A1508879F3AA3978E040A5A1691744E3 + B1274F29F783850B175E5D5656664CD7D7504A8D86CD9152228498F29024A524 + 9BCD522C160987C3D9FEFEFE0F0A85C28D4AA98780C4A9E5274BBCF54B297F9D + CBE50E47A3D1FF66B7DBED42085D2985A66913BEE85155160A05128944A1BFBF + 3F6B18860074BBDD3EA59B1845D334344DD3E3F1F83A29E5F3C0004043434383 + 8E78D6E17018DFF8DBBBC4BA75EBA8ABAB9BB09D68344A6767276D6D6DF4F7F7 + 6359161E8F6756864AC33058B46811D15894705F1F8383831FABAAF41D8CC463 + 87468AACB6D96C8F2C58B0C0E572B9A66D43269321954A15C2E170164008A18F + C692747DFCD729A5249FCF93CBE548A55285AEAEAEC16C36FB5529E5DF03FD13 + 5D6B2A59D9234AA907D2E9B4231E8FAF75381CBA524A1B75724653EF236317C5 + 6291482492EDE9E989A752A97FC9E7F3FF904C26AFF27ABD0B469DD7A9329AAA + 2E2F2FB7C762B11B46145EACF27A7F83E2C2BBBEFD6DD1D0D0C0FAF5EBC7AD9F + C964D8BC69333B77ED64CB0B2FB0F5F5ADBCB76F2FC78E1DA3BDBD1DBFDF3F2B + FE89CBE5C266B3513DBF9A37B66E05B8BCC6BEF8A181CC804DD3B4B71A1B1BE7 + 9FCD503DDA138742A10F73B9DC0DA9542A1489443E2184108661D88AC5E29823 + 7AE2928891D98BD5DDDD9D4D2693F749296F010E9CE97A537D53A652EA3529E5 + C3A954AA6C68686885655945CBB284699A229BCD1663B1582E1C0E5B9148E460 + 3299FCBE52EA6B4AA9B78001A5D49E5C2E777B7979B9CD66B34DEB6B310C0329 + 250E87A33C9D4E7FB271C9920E81B8E782152B5877E97AAEBDF6DAB154F68914 + 0A051E7FFC71B6BCF8027F78EA693A0201FA7A7B097587F8E0BDF7693BD28AC3 + E9645E75353E9F6F521B92C9241F7CF001FBF6EEE3D8B163D8ED762A2A2A26AD + 336FDE3C3A3A3AF0FB7D1C3C70A0B26814538954F2078B172FBED0E9746AA34B + 16A6432E9723140A650B85C29F03FB95523B9552F7A5D3E9AE783CBE341E8F57 + 9AA6591819D24526932946A3D1CCF1E3C7B3C964F211CBB2362AA53633C548EE + 743DA1B065597F0B7C2712895C1A89449A189EE90C01C780771967EC02F6150A + 85C352CA4B2CCB1AFB624CD3C4B22C8410E8BA3EE170E572B99052DAE6CD9BB7 + A158349FB6DBEDDCF6A52F72D1451751565636AEA1EFBCF30EBBDF7D977776EE + 1AF7FFFDFDFDFCF6D1DFE0703A6968689870DC6E6969E1EDB7DE66EF9E3D8442 + DD94979773F9860D2C5DBA94CFDF74D3845FBF10820D1B3690C964D0751DD334 + 7F386FDE3CDC6EB731D1EC4429859412CBB2504AA1EBFA69CFAA582C1E064E9C + 011581C74CD37C0CA8181C1CBC14580C54313C0CB703BB198E594D8BB375932D + 86236E538D04629AE6FD8944E297866138755D279BCD625916994CA6680C2346 + 0532FA5046872021C4A8081C662EBFB0A1B1114DD759B56AD584D7EBE8E860EF + EEDD93DA34343444341A65606080050B168CDBC6D6AD5B79E4570F9D943CDCFF + C1875C77C3F52860E3C68D13B6BF60C1022A2B2BB9F5B62FF0E4E34F382A3D15 + 9CEA67589635F6E24785619AA6324DD32C2B2BB3E9BA8ECBE5A2582C924C2673 + A669FE6C925B4A00AF4E7AD3D3602EE750CF0E0E0EFEA2A2A2825C2E47369BB5 + 42A1D031CBB2EED134CDAB69DA7A29E595E5E5E586D7EB2D733A9DFA68B06D74 + A99C2E0426F0E71B6F61C58A154CE6E02A29318B67EE3DE5C84B3915D334D9BA + 752BBFFFEDEF4ECB2A2BA568DEF212B54B96D0D9D9C9D2A54B276C7FCD9A35C4 + E3710004C3CEBC94722CFB2BA52497CB99B1582C9B4AA58A9AA6ED9052EE9152 + C6745DFF5E5D5D5DCDA8D3393838A880CD67BCA919622EC59102DE0736589645 + 4F4F4FCCB2AC35406CD48102482412AB52A9D4AD4288AF391C8EEAEAEA6A97C3 + E1D0344DC3CC0F2F14F2FA7C2C5FBE7CD28BD5D6D672E1C517B3EBEDB7272C53 + EEF1E0F7FBC7CDBD74767672B4B393A1C1C171EB2AA578F5E597A9ABAB9B541C + B5B5B528A558D6D4444720309662C8E7F3D6C0C0402E9FCF0F28A51E91523E03 + 1C3E51A896653DD1DDDD1D58B66C996F2492B99BF187ED59614EA32FA6693E95 + CD66D70B218494F267406C9C6287A49477037767329955A150E80E21C45F5556 + 547A7C1515EE75EBD7E17038CE18D3B8E2939FA4BBBB9BC18101DADBDA4EFBBF + DBEDE62B77FC25975E76D9B87E435B5B1B2D1FEE9FF41A5D5D5D249249466340 + E3218460E9D2A55C73ED67E908048847A3F981A1A1A852EA5129E56F8143E356 + 1C26A294BA3F9FCFFFB394529AA6F9CCA406CD30731B9A83E66834FA63BBDD8E + 94F28D29943F24A5FC1EF03D97DDF123E09FFF6CFD7A162F5E7CC68A6EB79B5B + 366EC466B773ACA7877D7BF7128FC5B13BEC342D5FCEEA0B2F64FDFAF5AC59B3 + 66DCFAF1789C58343AE935941C0E4167B35926CBAAD6D4D4B07024D7E3B43B5F + B72CEB7367BC8111A494AFA752A9EF66B359014CE599CD18732D8ED64C2663E5 + F37927D03A9D8A4EA77D010C3B79534DAAF9FD7EEEB8E30EBABBBBB9ECF2CB89 + 46A3381C0EEAEBEB696A6A62B29C8610023185C8E354F24E353535486B78B8D0 + 356DF2F1F0740E2712099B65590526EF65669CB9160742883B9552AB199EFE4E + A7E24A14084D9B56985C08417D7D3DF5F5F5672E7C023E9F0F9FDFC7F163C726 + 2CA3EB3AA30BA927C36EB7A31B3A8B6A16D17BFC78E3EAD5ABED070F1E2C4CD1 + 9441A5D44F84100798E34D5F3397279E229665FDC134CDBBA75D51D134BA3460 + 3A4BFCCE96E5CB97F3F1B56B272DD3B8B411AFD73BA5DC86D7EBE563AB5603C2 + C864328DD3B1C534CDBB2DCB9A9145C3D361CEC5710EF8FD7E3FD38DB09E2D8D + 8D8DD4D5D78FF90AA72234C167AFBB8ECB2FBF7C4AEDB95CAEB11E4F576AF290 + EC79424988E3924B2EB1018E8ACA8A7143E5B381AEEB5C73CD35FCC5ED5F392D + BCAEEB3A37DFB2910B56AC9834E1772276BB9D32F77034D79262F6BBBE1960CE + 7D8EB3211C0E1B0EDD9876DAFF5CA9ABAB1BCBDD1C3E7888E0D1A3782A3CAC5B + BF9EA6E5CBB9F6DA6BA7DCD670E477F8710B21A7979EFE88280971F4F4F46497 + D537E4A391A86374C7DC5CD1D4D4446D6D2D1D1D1DF4F5F5515151416363E3B4 + 57B2170A0532E991EDAC4A8FCF82A9334E49886384C4D0D050F54CAE559D2A4E + A793D5AB57B37AF5EAB36EA35028904A8D88435212E228099F0300456C345B39 + D162D9F39991C54F000887182F327CDE513AE2D08643ED8661CCE84AF7B9A250 + 28108F0E6B4208F1A79E6326112379184DD3C6769D9712854281582C06200381 + C08C9FA5311B948C38A4526118DE6E37D9C6ECF3956C364B5F5F1F4098993F5E + 625628197168427402E40B8569EFC3FDA8C964321886317A3649F0233667CA94 + 8C38141C0548C462638E5DA9904AA5D0FF18620F7E84A64C8B921187B4440740 + 381C2EB99E23994C8E39D14AFD491C338E4D153B01BA825D25D9738CFA4942E3 + 5C0E7A99534A461C6D3D3DC781EC9123874BB2E7181C596E28FE34ACCC0A0A08 + C663F1B10D3BA5422A951A5B1762F2A79E6396189EB11886311A33280962B118 + 1D810E00552814E6E2D8CA19A1C4C4C1118042BE402472EAC6F5F313D334C966 + B374058300DDC78F1FCF9CA1CA7943498943283E0018E8EF6768687AAB0C3F2A + 229108230BAA61C4FE52A1A4C401D67B00ADADAD25258E5C76F86022A1CDFEC9 + CC3349498923D0DDDD0A64F6EDD9C3E0E0E08C9C3F36DBF4F7F7D31FEE03402A + 35F94698F38C9212076081783F994C621F397BF37CA7BFBF9F0F3F181E4D94A6 + CDE8D9E4B34DA98903601B0CE72BC2E1F0476CCAE4148B4532990CEFBFF73E28 + 42E778D2F19C5372E250CA7A0386B72B1E9B644FC94C90CD66D9B469136DE36C + A79C0ABDBDBD689A367CE6BB38F9D8AA52A0E4C451907227907F73DB768E1F3F + 7EDA61FB53616060809E9E331F34DCD2D2423C1667F7EEDD135E279FCF130804 + C60DCA854221C2C3697A04DA8E691BFA115372E2E8E9E9C9A2D8363030806118 + F4F6F69EF4FFF6F676B66CD94226337E38211C0ED3DCDCCC1B6FBC3116D21E8F + 62B1486B6B2B8F3EFC304A4ADADBC7FF8184EDDBB7B37BF76E5E78E185D3AE19 + 0A8578A5F96500A50CEDACCE71FF282939710C237E0F10686F1FEBF2A594ECDA + B58BDDBB77D3DFDFCFA143A76F2B8D46A3BCFAEAABBCB97D07470E1DE2ED498E + 67686B6B434A49777737AFBFFA2AFBF7EF3F6D76140A85181818E0EE1FFE90F6 + B636363DFFFC98E0FAFAFA9052D2110800EAED8E8E8ED0389739AF294971182E + FB734288EC0B9B36130A858846A3343737D3110870EF3DFF5B3DFBF433B4B7B7 + 9FF432D3E934CDCDCDB47CF8215B5F7B8D271F7F82742A4D6BEBE9FBB99552B4 + B4B4D0FCE2F0EFEBBDF5E65B98A64977F71F23DF9665B173E74EDEDCB60DB368 + F2CB9F3FC8BBEFBC43737333C1609083070F12EA1A2E2FE089597E24B342296D + 4D18A3B5B535B9B4BEFE0FD168F4F65C2EC773CF3D47269DE6FE9FDD8794521C + 3A78102925BDBDBDD4D4D490CFE779E9A597087676F287A79F01880395CF3EF3 + 3452491A1B1B4F3A25A8ABAB0B6949F6ECDE03C3476B3BDFDFBB0F8FC733B621 + 7BFFFEFDE473795E7BF535805601EA85CDFFB5B22734DC4128A5F8FD7FFE2742 + 881C86F1D49C3EA01962B67E0070D6A9AAAC6C4388AFB7ECDF2FCA5C65E2B1FF + 7814506985DA2C10AB1A972EC5ED76535B5B4B737333C78F1DE3E7FFFE004288 + 01656997094DAEEDEB0BD75D7AD96598A6C992254BC6DADEB16307BB76EEA4F5 + C81110DC05AC6B6B6D2DBFFC8A0D2C5AB408A5143B76ECE03F1EFAF5C8DA12F5 + 454B881FEB824BFA7AFB961D3A78489945531C397408040F747476CEF926E899 + A064C51189C7077C955E67A190FF545B6B2B0A8E2A4BFB8C61D99F50BAF59DAE + 60505FB17225FDFDFD84FBFAF8B77FBD07814849293EDBD9D379C0EBF7BF2714 + 7F73B0E580B860E54AB164C9125C2E170303031C3E7C985F3DF80B9452BDC266 + 7C0DA96C4AA94F2F5DBA14C366100A85E8ECE8E0F5D75E0378A2A3ABEBDE582C + 96BB38167B3CEEF5CDCBA453EB3B020150842CC11763B1D88407FB9FCF94A4CF + 314A6777F0FB4289DB04EA9BE8DADACE9ECE96B6E36D83C08BD14804010C0E0C + 0C0B4388A2A5B8A533D4B917E0E8D1A31F82FA792C161381B6F631E7B4A5A585 + EE607064E3947A201008E46D66E14105E9DFFFEE77AAB7B797FEFEFEE19FCF40 + A474CBFCFB517BB681D9D975F49B4213D7A2F8B629D4A5C160B074D6169C42C9 + F61CA344E2B14391787C4F341A1DDBCCE2F779F3C097E2F1189B9FDFA4F2F9BC + 52A8BF3ADA1DDC7462DD4A9F6F972EC49D075A5ADC1B3E79059665D1DEDECEAF + 1EFC85324D3367338B5F194C26B383C964D6E7F5D558A6B9FEE36BD7B277F7BB + 04DA0380F87E20D47DDA1435128B7544E3B177E3F17849EC4F99889217C7782C + 5DB6AC239FC97EBEAFAF6F61B1584409BEDBD9D5F5D0A9E562B158CE5B593984 + E2A6442281ABAC8C6C26CB8EEDDB85805FB785426307B45555785A11DA37F7ED + DDA30D0B8343DE79555FEBEDED2D893D286743490F2B13B16FDFBE2236E34A25 + F86B81BAA23318BC6FA2B29D5D5D8F02EFECDBB317CBB278EAF1C701A4D4B593 + EA0442A10EA5F8AE655A591421A9892FEFDBB7AFF4F6654E83B9FD859DF39465 + 75759720B4DD233F55068A4D1DDDC19BC72BDBD4D4E4080402A5B71FF32CF8FF + 7258992ED178BCD7E7F3F6A3D4A5408B2ECDAF0E2512E32E718F4422D34FE694 + 28FF0F23E07CF43584AF3F0000000049454E44AE426082 + } + Transparent = True + Visible = False + end + object Timer1: TTimer + Interval = 50 + OnTimer = Timer1Timer + left = 23 + top = 18 + end +end diff --git a/lazarus/platformer/unit1.pas b/lazarus/platformer/unit1.pas new file mode 100644 index 0000000..ed7c1e6 --- /dev/null +++ b/lazarus/platformer/unit1.pas @@ -0,0 +1,131 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, ExtCtrls, + Dialogs, LCLType; + +type + + { TForm1 } + + TForm1 = class(TForm) + Image1: TImage; + Timer1: TTimer; + procedure FormCreate(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormPaint(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +const + speed = 10; + jump = 30; + gravity = 2; + +var + Form1: TForm1; + blocks: array of TRect; + px, py, vx, vy: integer; + upKey, leftKey, rightKey: boolean; + +implementation + +uses Math; + +{$R *.lfm} + +procedure GenerateBlocks; +var + i: integer; + width: integer; +begin + Randomize; + SetLength(blocks, 10); + for i := 0 to length(blocks)-1 do begin + width := Random(200) + 100; + blocks[i].Left := Random(Form1.ClientWidth - width); + blocks[i].Right := blocks[i].Left + width; + blocks[i].Top := Random(Form1.ClientHeight - 10 - Form1.Image1.Height) + Form1.Image1.Height; + blocks[i].Bottom := blocks[i].Top + 10; + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + GenerateBlocks; + px := (blocks[0].Left + blocks[0].Right) div 2; + py := blocks[0].Top; + vx := 0; vy := 0; +end; + +procedure TForm1.FormPaint(Sender: TObject); +var + i: integer; +begin + Canvas.Brush.Color := clBlack; + for i := 0 to length(blocks)-1 do begin + Canvas.FillRect(blocks[i]); + end; + + Canvas.Draw(px - Image1.Picture.Bitmap.Width div 2, + py - Image1.Picture.Bitmap.Height, + Image1.Picture.Bitmap); +end; + +procedure TForm1.Timer1Timer(Sender: TObject); +var + i, j: integer; +begin + vy := vy + gravity; + + if leftKey then px := px - speed; + if rightKey then px := px + speed; + + if vy > 0 then begin + for j := 0 to vy-1 do begin + for i := 0 to length(blocks)-1 do begin + if (py = blocks[i].Top) and (px > blocks[i].Left) and (px < blocks[i].Right) then begin + if upKey then vy := -jump else vy := 0; + Refresh; + exit; + end; + end; + py := py + 1; + end; + end else begin + py := py + vy; + end; + + Refresh; +end; + +procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_UP then upKey := true; + if Key = VK_LEFT then leftKey := true; + if Key = VK_RIGHT then rightKey := true; + + if Key = VK_SPACE then GenerateBlocks; + if Key = VK_ESCAPE then FormCreate(nil); +end; + +procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_UP then upKey := false; + if Key = VK_LEFT then leftKey := false; + if Key = VK_RIGHT then rightKey := false; +end; + +end. +