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
|
////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
////////////////////////////////////////////////////////////////////
BMAP* mouse1_pcx = "mauszeiger_menue.bmp"; // bitmap used for the mouse pointer
VECTOR ball_speed;
ENTITY* ball;
////////////////////////////////////////////////////////////////////
function main()
{
video_mode = 7;
screen_color.blue = 150;
mouse_map = mouse1_pcx;
mouse_mode = 2;
while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait (1);
}
}
function play()
{
fps_max = 140;
level_load("level_1.wmb");
ball = ent_create ("ball.mdl", vector(-400, 0, 100), NULL);
ph_setgravity (vector(0, 0, -400));
wait (2);
phent_settype (ball, PH_RIGID, PH_SPHERE);
phent_setmass (ball, 3, PH_SPHERE);
phent_setfriction (ball, 100);
phent_setdamping (ball, 30, 40);
phent_setelasticity (ball, 50, 20);
while (1)
{
ball_speed.x = 30 * (key_cur - key_cul);
ball_speed.y = 30 * (key_cuu - key_cud);
ball_speed.z = 0 ;
phent_addtorqueglobal (ball, ball_speed);
camera.x = ball.x - 300;
camera.y = ball.y - 300;
camera.z = 1000;
camera.tilt = -60;
wait (1);
}
}
if(key_space)
{
ball_speed.x = 50 * (key_cur - key_cul);
ball_speed.y = 50 * (key_cuu - key_cud);
ball_speed.z = 30 ;
}
//////////////////////////////////////////////////////////////////////
PANEL* main_pan =
{
bmap = "BMap_menue_1.pcx";
pos_x = 0;
pos_y = 0;
button (250, 134, "button_spielclicked.pcx", "button_spiel.pcx", "button_spielover.pcx", play, NULL, NULL);
layer = 3;
flags = OVERLAY | VISIBLE;
}
//////////////////////////////////////////////////////////////////////
|