Featured Titles
Voxerpunk Dev Log
posted by Marcus, December 6, 2019 @ 9:34 pm
Subscribe for updates…
On this page you’ll find sneak peeks and project updates for Voxerpunk as well as sample code for other ‘RPG in a Box’ developers.
[youtube]KrjUfysT3mk[/youtube]
[youtube]deLqaKoMlN0[/youtube]
[youtube]vVeQiP3dBGo[/youtube]
[youtube]HbFQjKxwJcY[/youtube]
[youtube]PjO8TlXT88o[/youtube]
Sample script (ranged combat):
stop_player();
wait(1); // Time to finish walk anim if fired while moving
set_player_movement_locked(true);
set_movement_speed(player, 0);
play_animation(player, "fire");
wait(0.7); // Give player time to draw gun
hit_length = 10; // Used for beam clean-up. Default to max length beam
if player.direction == "north" then
ray_count = 0;
while ray_count < 10 do
ray_count += 1;
zap_str = "ray" + ray_count;
for enemies_var in group["enemies"] do
if enemies_var.coord.x == player.coord.x then
if enemies_var.coord.y == (player.coord.y - ray_count) then
damage_entity(enemies_var, 1);
add_object("zap_hit_north01", coord[player.coord.x, player.coord.y - ray_count, player.coord.z], zap_str);
play_animation(enemies_var, "hit");
hit_length = ray_count; // Save beam length for clean-up
wait(1.2); // Give hit animation time to finish
remove_entity(zap_str); // Clean-up hit object
ray_count = 10; // End while
end
end
end;
add_object("zap_north01", coord[player.coord.x, player.coord.y - ray_count, player.coord.z], zap_str);
wait(0.05); // Delay between beam segments to simulate movement
end;
else
if player.direction == "south" then
ray_count = 0;
while ray_count < 10 do
ray_count += 1;
zap_str = "ray" + ray_count;
for enemies_var in group["enemies"] do
if enemies_var.coord.x == player.coord.x then
if enemies_var.coord.y == (player.coord.y + ray_count) then
damage_entity(enemies_var, 1);
add_object("zap_hit_south01", coord[player.coord.x, player.coord.y + ray_count, player.coord.z], zap_str);
play_animation(enemies_var, "hit");
hit_length = ray_count;
wait(1.2);
remove_entity(zap_str);
ray_count = 10;
end
end
end;
add_object("zap_south01", coord[player.coord.x, player.coord.y + ray_count, player.coord.z], zap_str);
wait(0.05);
end
else
if player.direction == "east" then
ray_count = 0;
while ray_count < 10 do
ray_count += 1;
zap_str = "ray" + ray_count;
for enemies_var in group["enemies"] do
if enemies_var.coord.y == player.coord.y then
if enemies_var.coord.x == (player.coord.x + ray_count) then
damage_entity(enemies_var, 1);
add_object("zap_hit_east01", coord[player.coord.x + ray_count, player.coord.y, player.coord.z], zap_str);
play_animation(enemies_var, "hit");
hit_length = ray_count;
wait(1.2);
remove_entity(zap_str);
ray_count = 10;
end
end
end;
add_object("zap_east01", coord[player.coord.x + ray_count, player.coord.y, player.coord.z], zap_str);
wait(0.05);
end
else
ray_count = 0;
while ray_count < 10 do
ray_count += 1;
zap_str = "ray" + ray_count;
for enemies_var in group["enemies"] do
if enemies_var.coord.y == player.coord.y then
if enemies_var.coord.x == (player.coord.x - ray_count) then
damage_entity(enemies_var, 1);
add_object("zap_hit_west01", coord[player.coord.x - ray_count, player.coord.y, player.coord.z], zap_str);
play_animation(enemies_var, "hit");
hit_length = ray_count;
wait(1.2);
remove_entity(zap_str);
ray_count = 10;
end
end
end;
add_object("zap_west01", coord[player.coord.x - ray_count, player.coord.y, player.coord.z], zap_str);
wait(0.05);
end
end
end;
stop_player()
end;
set_player_movement_locked(false);
wait(0.4); // Give beam animations time to finish
ray_count = 0;
while ray_count < hit_length do
ray_count += 1;
zap_str = "ray" + ray_count;
remove_entity(zap_str)
end;
play_animation(player, "donefiring");
wait(1); // Give player time to holster gun
set_movement_speed(player, 50)
<End of Script>
Posted:
Friday, December 6th, 2019 at 9:34 pm
Categories: Featured.
Follow responses: RSS 2.0
Both comments and pings are currently closed.
Categories: Featured.
Follow responses: RSS 2.0
Both comments and pings are currently closed.
Comments are closed.