-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
187 lines (135 loc) · 5.33 KB
/
index.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html>
<head>
<title>F Snake</title>
<link rel=stylesheet href=rr/style.css />
<link rel=stylesheet href=rr/bootstrap.min.css />
<link rel="icon" type="image/jpg" href="https://raw.githubusercontent.com/mngz47/productlists-resources/main/p_logo.jpg">
<meta name="autor" content="@mongezisibongakonke" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-image:url(images/dragon.jpg);background-size: 100% auto;background-repeat:no-repeat;" >
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FW4M5RXDKZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FW4M5RXDKZ');
</script>
<script src="https://www.paypal.com/sdk/js?client-id=AVgbolJTHs0bKbVOLfW4EF1YXqPQ2_MigSOxL5o4bGgZen6euXGoYf1vlkKTVxdbdzUFDsJcII7EcI7N&components=buttons"></script>
<script src=rr/api.js ></script>
<script src=rr/player.js ></script>
<script src=rr/payfast.js ></script>
<script src=rr/cookie.js ></script>
<script src=rr/challenge.js ></script>
<script src=rr/drag_n_drop.js ></script>
<script src=rr/user_experience.js ></script>
<script src=rr/f_snake_listener.js ></script>
<script src=rr/f_snake_navigation.js ></script>
<script src=rr/f_snake_detection.js ></script>
<script src=rr/effects.js ></script>
<script src=https://mngz47.github.io/pamel_slots/rr/monetize.js ></script>
<div id=start style="position: absolute;background-color:rgba(0,0,0,0.7);width:100%;height:100%;" >
</div>
<script>
e('start').innerHTML += main_menu()+footer_menu();
</script>
<iframe id=four_target src="https://mngz47.github.io/F-Snake/header.html" width="468" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
<div style="width:600px;margin-left:auto;margin-right:auto;background:rgba(128,128,128,0.6);" >
<div style="width:600px;" >
<span style="font-size:3em;">Flower Snake</span>
<span id="speed" style="font-size:1.7em;float:right;color:green;margin:7px;" ></span>
<span id="points" style="font-size:1.7em;float:right;color:green;margin:7px;" ></span>
</div>
<div id="canvas" style="width:600px;height:400px;border: 3px solid blue;background:white;" >
<img id="food" src=images/flower.jpg style="width:40px;border-radius: 25px;position:absolute;" />
<!-- <span id="food" style="font-size:2.2em;position:absolute;" >O</span> -->
<span id="stacle" style="font-size:2.2em;position:absolute;" style="color:purple;" >X</span>
<span id="head" style="color:red;font-size:2.2em;position:absolute;left:400px;top:200px;" >F</span>
</div>
</div>
<div style="position:fixed;width:100%;margin-top:-20px;background:rgba(128,128,128,0.8);font-size:2.2em;">
<a href=# onclick="d='t';moves+=1;return false;" style="float:left;margin:7px;padding:20px;" >U</a>
<a href=# onclick="d='r';moves+=1;return false;" style="float:right;margin:4px;padding:20px;" >R</a>
<a href=# onclick="d='l';moves+=1;return false;" style="float:left;margin:7px;padding:20px;" >L</a>
<a href=# onclick="d='b';moves+=1;return false;" style="float:right;margin:4px;padding:20px;" >D</a>
</div>
<script src=rr/f_snake_features.js ></script>
<script>
var points = 0;
var d = "r";
var mode = "easy";
var stage = 1;
timerId = setInterval(gameTimer,1000);
var moves = 0;
f_listen();
var speed = 60;
var game_over = false;
async function start(){
playTheme();
while(!game_over){ //continuosly move the snake head so long as the game is not over
f_navigate();
f_detect();
show_body(e('head').offsetLeft,e('head').offsetTop); //renders the body of the snake
speed = Math.round((40 - 40 * (points*3)/15)); //increases speed of the snake as the points increase
// e('speed').innerHTML = 'SPEED:'+Math.round(7 * (points*3)/15);
await new Promise(r => setTimeout(r, speed));
}
}
//start();
/*
setInterval(function(){
},speed);
*/
//1000*(8-stage)
setInterval(placeStacle,1000*(8-stage));
</script>
<!--
<div id=controls style="left:50px;top:0px;" >
<div id=control-move >Players</div>
<a href=# onclick=toggle(e("players")); >toggle</a>
<div id=players ></div>
<script>
showPlayers(e('players'));
toggle(e("players"));
</script>
</div>
<div id=controls style="left:100px;top:0px;" >
<div id=control-move >Strategy</div>
<a href=# onclick=toggle(e("strategy")); >toggle</a>
<div id=strategy ></div>
<script>
showStrategy(e('strategy'));
toggle(e("strategy"));
</script>
</div>
<div id=controls style="top:0px;float:right;" >
<div id=control-move >Log</div>
<a href=# onclick=toggle(e("log")); >toggle</a>
<div id=log style="top:0px;float:right;background:black;" ></div>
<script>
toggle(e("log"));
</script>
</div>
-->
<link rel=stylesheet href=rr/f_snake_style.css />
<link rel=stylesheet href=rr/drag_n_drop.css />
<link rel=stylesheet href=rr/effects.css />
<link rel=stylesheet href=rr/mobstyle.css />
<audio controls id=theme >
<source src="sounds/snake_music.mp3" type="audio/mp3" loop="loop" >
Your browser does not support the audio tag.
</audio>
<audio controls id=snake_death_sound >
<source src="sounds/f_snake_death.mp3" type="audio/mp3" >
Your browser does not support the audio tag.
</audio>
<script>
checkChallenge();
confirmChallenge();
toggle(e('theme'));
toggle(e('snake_death_sound'));
</script>
</body>
</html>