Changeset 34463
- Timestamp:
- 07/18/09 00:04:57 (4 years ago)
- Location:
- lang/hsp/misc/obaq_battletank
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/hsp/misc/obaq_battletank/bomb.as
r34461 r34463 1 #module m_bomb x, y, angle, speed 2 #modinit double p_x, double p_y, double p_angle 3 x = p_x 4 y = p_y 5 angle = p_angle 6 speed = 5.0 7 return 8 9 #modfunc move_bomb 10 x += speed * cos(angle) 11 y += speed * sin(angle) 12 speed -= 0.1 13 return 14 15 #modfunc draw_bomb 16 circle x - 10, y - 10, x + 10, y + 10, 0 1 #module m_bomb obaq_id, life 2 #const double SPEED_MAX 0.6 3 #modinit double obaq_x, double obaq_y, double angle 4 qaddpoly@ obaq_id, 20, obaq_x, obaq_y, angle, 5, 5, colsw_none@, MY_WEAPON_GROUP@, MY_GROUP@ 5 speed_x = SPEED_MAX * cos(angle) 6 speed_y = SPEED_MAX * sin(angle) 7 qspeed@ obaq_id, speed_x, speed_y, 0.0, 1 8 qinertia@ obaq_id, 0.97, 1.0 9 life = 20 17 10 return 18 11 19 12 #modfunc burst_bomb 20 qcnvaxis@ scr_x, scr_y, x, y, 1 21 qblast@ scr_x, scr_y, 3, 1, 20 22 title "x:" + x + "\ty:" + y 13 qgetpos@ obaq_id, obaq_x, obaq_y, angle 14 qblast@ obaq_x, obaq_y, 3, 1, 20 15 qdel@ obaq_id 16 17 qcnvaxis@ scr_x, scr_y, obaq_x, obaq_y, 0 18 color 255 19 circle scr_x - 30, scr_y - 30, scr_x + 30, scr_y + 30, 1 23 20 return 24 21 25 22 #modfunc __burst 26 return speed < 0.3 23 life-- 24 return life < 0 27 25 28 #defcfunc need_to_burst var p_bomb29 __burst p_bomb26 #defcfunc need_to_burst var bomb 27 __burst bomb 30 28 return stat 31 29 #global -
lang/hsp/misc/obaq_battletank/obaq_battletank.hsp
r34461 r34463 1 1 #include "obaq.as" 2 #const MY_GROUP 0x00000001 3 #const ENEMY_GROUP 0x00000010 4 #const MY_WEAPON_GROUP 0x00000100 5 2 6 #include "bomb.as" 3 7 #include "tank.as" … … 8 12 qreset 9 13 qgravity 0, 0 10 dimtype bomb_list, DIMTYPE_MODULE, 16 14 qborder -60, -50, 60, 50 15 dimtype bomb_list, DIMTYPE_MODULE, 16 16 dimtype target_list, DIMTYPE_MODULE, 16 11 17 12 hako=10 13 repeat 100 14 if hako=0 : break 15 qaddpoly my, 15, rnd(ginfo_winx), rnd(ginfo_winy),0,5,5 ; ���p�`��� 16 if my>=0 { 17 hako-- 18 } 18 *create_targets 19 repeat length(target_list) 20 x = rnd(100) 21 y = rnd(80) 22 qaddpoly target_list(cnt), 15, x, y, 0, 5, 5, colsw_none, ENEMY_GROUP 23 if target_list(cnt) < 0 : continue cnt 19 24 loop 20 25 … … 23 28 24 29 *main 25 redraw 0 ; ���̍X�V��n30 redraw 0 ; ���̍X�V��n 26 31 gradf ,,,,1,0,128 ; ���N���A 27 qexec ; OBAQ�ɂ��I�u�W�F�N�g�̍X�V32 qexec ; OBAQ�ɂ��I�u�W�F�N�g�̍X�V 28 33 29 34 stick key, 15 ; �L�[�̎擾 30 35 if key&128 : end 31 if key&2 : move_tank tank32 rotat e = (key & 1) - ((key >> 2)& 1)33 rotate_tank tank, 0.1 * rotate36 direction = ((key >> 1) & 1) - ((key >> 3) & 1) 37 rotation = ((key >> 2) & 1) - (key & 1) 38 accel_tank tank, direction, 0.01 * rotation 34 39 35 40 if key&16 { … … 37 42 } 38 43 39 qdraw ; �I�u�W�F�N�g�̕`��40 color 255,255,25541 qcnvaxis x,y,xx,yy42 43 draw_tank tank44 44 foreach bomb_list 45 move_bomb bomb_list(cnt)46 draw_bomb bomb_list(cnt)47 45 if need_to_burst(bomb_list(cnt)) { 48 46 burst_bomb bomb_list(cnt) … … 51 49 loop 52 50 51 qdraw ; �I�u�W�F�N�g�̕`�� draw_tank tank 52 53 53 54 redraw 1 ; ���̍X�V��� 54 55 await 16 ; �����ԑ҂� -
lang/hsp/misc/obaq_battletank/tank.as
r34461 r34463 1 #module m_tank x, y, angle2 # const double SPEED 3.03 # modinit double p_x, double p_y, double p_angle4 x = p_x 5 y = p_y6 angle = p_angle1 #module m_tank obaq_id 2 #include "hspmath.as" 3 #const double SPEED 0.4 4 #modinit double scr_x, double scr_y, double angle 5 qcnvaxis@ obaq_x, obaq_y, scr_x, scr_y, 1 6 qaddpoly@ obaq_id, 5, obaq_x, obaq_y, angle, 10.0, 10.0, colsw_none@, MY_GROUP@, MY_GROUP@ 7 7 return 8 8 9 #modfunc move_tank 10 x += SPEED * cos(angle) 11 y += SPEED * sin(angle) 12 return 13 14 #modfunc rotate_tank double p_angle 15 angle += p_angle 16 return 17 18 #modfunc shoot array list 19 newmod list, m_bomb, x, y, angle 9 #modfunc accel_tank int direction, double rotation 10 qgetpos@ obaq_id, obaq_x, obaq_y, angle 11 speed_rot = rotation 12 speed_x = SPEED * cos(angle) * sgn(direction) 13 speed_y = SPEED * sin(angle) * sgn(direction) 14 qspeed@ obaq_id, speed_x, speed_y, rotation, 1 20 15 return 21 16 22 17 #modfunc draw_tank 23 theta = M_PI / 4 + angle 24 pos x + cos(theta) * 20, y + sin(theta) * 20 25 repeat 4, 1 26 theta += M_PI / 2 27 line x + cos(theta) * 20, y + sin(theta) * 20 28 loop 18 qgetpos@ obaq_id, obaq_x, obaq_y, angle 19 qcnvaxis@ scr_x, scr_y, obaq_x, obaq_y, 0 20 color 255, 255, 255 21 line scr_x, scr_y, scr_x + cos(angle) * 40, scr_y + sin(angle) * 40 22 return 23 24 #modfunc shoot array bomb_list 25 qgetpos@ obaq_id, obaq_x, obaq_y, angle 26 newmod bomb_list, m_bomb, obaq_x, obaq_y, angle 29 27 return 30 28 #global
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)