-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlatformer.fprg
More file actions
139 lines (139 loc) · 6.61 KB
/
Platformer.fprg
File metadata and controls
139 lines (139 loc) · 6.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0"?>
<flowgorithm fileversion="4.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="Tsunami014"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2024-03-20 08:49:44 PM"/>
<attribute name="created" value="VHN1bmFtaTAxNDtNQVgtVFNVTkFNSTAxNDsyMDI0LTAzLTE5OzExOjE0OjI1IEFNOzMxMTk="/>
<attribute name="edited" value="VHN1bmFtaTAxNDtNQVgtVFNVTkFNSTAxNDsyMDI0LTAzLTIwOzA4OjQ5OjQ0IFBNOzk1OzMzMTA="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<call expression="failsafe"/>
<declare name="player" type="Integer" array="True" size="2"/>
<assign variable="player[0]" expression="0"/>
<declare name="inp" type="String" array="False" size=""/>
<declare name="run" type="Boolean" array="False" size=""/>
<assign variable="run" expression="true"/>
<while expression="run">
<input variable="inp"/>
<if expression="isIn(inp, "d")">
<then>
<assign variable="player[0]" expression="player[0] + 1"/>
</then>
<else/>
</if>
<if expression="isIn(inp, "a")">
<then>
<assign variable="player[0]" expression="player[0] - 1"/>
</then>
<else/>
</if>
<output expression=""Player pos: " & player[0]" newline="True"/>
</while>
</body>
</function>
<function name="Failsafe" type="None" variable="">
<parameters/>
<body>
<declare name="input" type="String" array="False" size=""/>
<assign variable="input" expression=""""/>
<output expression=""Please type 'failsafe' and press enter to start playing!"" newline="True"/>
<while expression="input != "failsafe"">
<input variable="input"/>
</while>
</body>
</function>
<function name="GetLevel" type="String" variable="screen">
<parameters>
<parameter name="Xpos" type="Integer" array="False"/>
</parameters>
<body>
<declare name="screen" type="String" array="False" size=""/>
<declare name="world1" type="String" array="True" size="12"/>
<comment text="Auto generated code below"/>
<assign variable="world1[0]" expression="" ""/>
<assign variable="world1[1]" expression="" ""/>
<assign variable="world1[2]" expression="" # ""/>
<assign variable="world1[3]" expression="" # S # ##### E F ""/>
<assign variable="world1[4]" expression=""##################################""/>
<comment text="Auto generated code above"/>
</body>
</function>
<function name="isIn" type="Boolean" variable="in">
<parameters>
<parameter name="str" type="String" array="False"/>
<parameter name="subchar" type="String" array="False"/>
</parameters>
<body>
<declare name="in" type="Boolean" array="False" size=""/>
<assign variable="in" expression="false"/>
<declare name="i" type="Integer" array="False" size=""/>
<for variable="i" start="0" end="Len(str)-1" direction="inc" step="1">
<if expression="in">
<then/>
<else>
<if expression="Char(str, i) == subchar">
<then>
<assign variable="in" expression="true"/>
</then>
<else/>
</if>
</else>
</if>
</for>
</body>
</function>
<function name="Render" type="String" variable="out">
<parameters>
<parameter name="arr" type="String" array="True"/>
<parameter name="isRow" type="Boolean" array="False"/>
</parameters>
<body>
<declare name="out" type="String" array="False" size=""/>
<assign variable="out" expression=""""/>
<declare name="i" type="Integer" array="False" size=""/>
<if expression="isRow">
<then>
<declare name="length" type="Integer" array="False" size=""/>
<assign variable="length" expression="0"/>
<for variable="i" start="0" end="Size(arr)-1" direction="inc" step="1">
<if expression="Len(arr[i]) > length">
<then>
<assign variable="length" expression="Len(arr[i])"/>
</then>
<else/>
</if>
</for>
<declare name="j" type="Integer" array="False" size=""/>
<declare name="anyInRow" type="Boolean" array="False" size=""/>
<for variable="i" start="0" end="length-1" direction="inc" step="1">
<assign variable="anyInRow" expression="false"/>
<for variable="j" start="0" end="Size(arr)-1" direction="inc" step="1">
<if expression="Len(arr[j]) > i*2">
<then>
<assign variable="out" expression="out & Char(arr[j], i*2)"/>
<assign variable="anyInRow" expression="true"/>
</then>
<else/>
</if>
</for>
<if expression="anyInRow">
<then>
<assign variable="out" expression="out & ToChar(13)"/>
</then>
<else/>
</if>
</for>
</then>
<else>
<for variable="i" start="0" end="Size(arr)-1" direction="inc" step="1">
<assign variable="out" expression="out & arr[i] & ToChar(13)"/>
</for>
</else>
</if>
</body>
</function>
</flowgorithm>