Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Master #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
272 changes: 272 additions & 0 deletions objects/obj_nipper_fire.object.gmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>spr_nipper</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>obj_deactenemyparent</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Quite the hothead
//States
//0 = Doing nothing
//1 = Opening its mouth
//2 = firing


//How vulnerable is this enemy to various items?
hardness = 0

//How vulnerable is this enemy to Mario?
stomp = 1

//Facing direction
direct = -1

//Animate
image_speed = 0.15

//Don't move
hspeed = 0

//Not doing anything yet
state = 0

//The amount of fireballs which will be spat in a salvo
fireballsalvo = 4

//Has not spat any fireballs in this round
hasspat = 0

//Fire projectiles
alarm[1] = 25
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="2">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Fire!

if instance_exists(obj_mario)
{
//Logic state
state = 2

//Spit fireballs which depend upon Mario's distance
if obj_mario.x &lt; x
{
with instance_create(x,y,obj_nipperfireball) hspeed = -0.03125*(other.x-obj_mario.x-8)
}
else
{
with instance_create(x,y,obj_nipperfireball) hspeed = -0.03125*(other.x-obj_mario.x+8)
}
//Add one to the amount of fireballs which have been spat so far
hasspat += 1

//Play quot sound
audio_play_sound(snd_fireball,0,0)

//Spit another unless it has already spat enough
if hasspat &lt; fireballsalvo
{
alarm[2] = 15
}
else
{
alarm[0] = 15
hasspat = 0
}

}
//If Mario's dead
else
{
alarm[0] = 2
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="1">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Ready, aim...

//Prepare to throw
state = 1
alarm[2] = 30
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///I'm just doing nothing
state = 0

//Prepare to fire
if instance_exists(obj_mario)
{
alarm[1] = 120
}

else
{
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Fire Nipper logic
//Which animation to pick and whether to be animated or not
if state = 0
{
sprite_index = spr_nipper
image_speed = 0.15
}
else
{
sprite_index = spr_nipper_jump
image_speed = 0
image_index = 0
}

//Look at Mario
if instance_exists(obj_mario)
{
if obj_mario.x &gt; x
direct = 1
else
direct = -1
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="8" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Draw the Fire Nipper
draw_sprite_ext(sprite_index,image_index,x,y,direct,1,0,c_white,1)
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints>
<point>0,16</point>
<point>16,16</point>
</PhysicsShapePoints>
</object>
123 changes: 123 additions & 0 deletions objects/obj_nipperfireball.object.gmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>spr_fireball</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-2</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Fire which acts like a hammer

//Animate
image_speed = 0.15

//Gravity
gravity = 0.2

//Move up
vspeed = -4.5
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Destroy below view
if y &gt; view_yview[0] + view_hview[0]
instance_destroy()

//Correct facing direction
if hspeed &lt; 0
image_xscale = -1

//Speed caps
if hspeed &gt; 2
{
hspeed = 2
}

if hspeed &lt; -2
{
hspeed = -2
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_mario">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Hurt Mario
with other event_user(0)
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints>
<point>8,0</point>
<point>8,8</point>
</PhysicsShapePoints>
</object>