Skip to content

Commit

Permalink
Initial sketch for plasma shooter plant.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettering committed Feb 29, 2012
1 parent bbd3663 commit 24ab30b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 37 deletions.
46 changes: 27 additions & 19 deletions data/level/test.cfg
Expand Up @@ -107,7 +107,7 @@ nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr,nbr
,nbr,nbr,nbr,nbr,nbr,nbr,,,nbr,nbr,nbr,nbr,nbr
,nbr,nbr,nbr,nbr,,,,,nbr,nbr,nbr,nbr,nbr
,nbr,nbr,nbr,nbr,,,,,nbr,nbr,nbr,nbr,nbr
,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,nbr
,
,
,
Expand Down Expand Up @@ -620,7 +620,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/tile_map]

[character]
_addr="0x24bd0a00"
_addr="0x24bdae00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -639,7 +639,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x2074de00"
_addr="0x20750c00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -658,7 +658,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x2074e200"
_addr="0x20751000"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -677,7 +677,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x2074ce00"
_addr="0x2074fc00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -695,7 +695,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bd9c00"
_addr="0x24be4000"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -719,7 +719,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bda200"
_addr="0x24be4600"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -737,7 +737,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bda800"
_addr="0x24be4c00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -758,7 +758,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdac00"
_addr="0x24be5000"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -776,7 +776,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdb400"
_addr="0x24be5800"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -794,7 +794,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdba00"
_addr="0x24be5e00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -812,7 +812,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdc200"
_addr="0x24be6600"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -830,7 +830,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdc800"
_addr="0x24be6c00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -849,7 +849,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdce00"
_addr="0x24be7200"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -863,7 +863,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdd200"
_addr="0x24be7600"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -877,7 +877,7 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bdd600"
_addr="0x24be7a00"
current_frame="normal"
custom="yes"
face_right="yes"
Expand All @@ -897,17 +897,25 @@ snd,snd,snd,snd,snd,snd,snd,snd,snd
[/character]

[character]
_addr="0x24bf4000"
_addr="0x24c5c200"
current_frame="normal"
custom="yes"
face_right="yes"
label="_35f1950"
label="_4b7edf4f"
time_in_frame="0"
type="plasma_shooter"
velocity_x="0"
velocity_y="0"
x="-672"
y="64"
y="32"
[vars]
charge_time="6"
charge_up="0"
is_upside_down="1"
points_value="13"
turns_at_cliffs="1"
[/vars]

[/character]

[serialized_objects]
Expand Down
51 changes: 33 additions & 18 deletions data/objects/enemies/experimental/plasma_shooter.cfg
Expand Up @@ -9,10 +9,11 @@
charge_time=6
[/vars]
[editor_info]
category=animals
category=plants
[var]
name=charge_time
value=6
name=is_upside_down
value="1"
type=boolean
[/var]
[/editor_info]
[consts]
Expand All @@ -29,7 +30,7 @@
shot_speed=1400
jump_power="-2000 - 1d500"
to_player = "mid_x-level.player.mid_x"
should_shoot="(distance(vars.crosshairs,level.player) < 20 and past_shooting_interval)"
should_shoot="(vars.crosshairs.is_locked and animation = 'open' and past_shooting_interval)"
past_shooting_interval="abs(level.cycle - vars.last_fired) > 60"
shoot="def() [set(vars.last_fired, level.cycle),
spawn('plasma_shooter.shot',mid_x+20*facing,mid_y,1,[set(velocity_x,xVel),set(velocity_y,yVel),set(rotate,angle_to(me,level.player)),set(zorder,context.zorder + 20)])
Expand All @@ -39,19 +40,18 @@
where yVel = (shot_speed*sin(angle_to(me,level.player)))"
[/properties]

on_create="spawn('plasma_shooter.crosshairs',level.player.mid_x + 1d200-100, level.player.mid_y + 1d200-100, facing)"
on_create="[set(upside_down, is_upside_down),
spawn('plasma_shooter.crosshairs',level.player.mid_x + 1d200-100, level.player.mid_y + 1d200-100, facing)]"

on_child_spawned="if(child.type = 'plasma_shooter.crosshairs', set(vars.crosshairs, child))"

on_timer="if(vars.crosshairs.is_locked, shoot())"
timer_frequency=8

on_collide_feet="animation('stand')"
on_enter_walk_anim=""
on_process_stand=""
on_end_opening_anim="animation('open')"
on_end_open_anim="if(should_shoot, [animation('open'),shoot()], animation('closing'))"
on_end_closing_anim="animation('closed')"
on_end_closed_anim="if(vars.crosshairs.is_locked,animation('opening'),animation('closed'))"

[base:animation]
image=enemies/hopper.png
image=enemies/plasma-shooter-plant.png
rotate_on_slope=yes
pad=3
accel_x=0
Expand All @@ -61,12 +61,27 @@


[animation]
id=hop
rect=1,66,32,93
frames_per_row=4
frames=8
duration=4
attack_area=26,18,35,28
id=closed
rect=1,1,58,58
duration=10
[/animation]

[animation]
id=open
rect=123,1,180,58
duration=10
[/animation]

[animation]
id=opening
rect=62,1,119,58
duration=10
[/animation]

[animation]
id=closing
rect=62,1,119,58
duration=10
[/animation]

[object_type]
Expand Down
Binary file added images/enemies/plasma-shooter-plant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24ab30b

Please sign in to comment.