Skip to content

Commit

Permalink
Added TriggerArea, made the minimap less transparent, and added FEELT…
Browse files Browse the repository at this point in the history
…ODO.md
  • Loading branch information
Ohmnivore committed Aug 23, 2014
1 parent 6c39ede commit b042f92
Show file tree
Hide file tree
Showing 19 changed files with 382 additions and 54 deletions.
Binary file modified Client/export/windows/cpp/bin/SkullRush.exe
Binary file not shown.
Binary file modified Client/export/windows/cpp/bin/shared/images/minimaptile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions FEELTODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
To improve:
* Sounds
* Add lots of bass to sound
* More obvious/exagerated animations
* Lower enemy hp
* Higher rate of fire
* More enemies
* Bigger bullets
* Muzzle flash
* Faster bullets
* Less accuracy (probably not)
* Hit animation
* Enemy knockback
* Permanence (gibs that stay forever)
* Screen shake (when firing)
* Player knockback upon firing
* Sleep on hit?
* Gun follow delay
* Gun kicks backward upon firing
* Gun shells permanence
* More destructive and spectacular weapons
* Random explosions
* Faster enemies
* Bigger explosions
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ At the moment the client source code is a mess. I'll clean it up one day.
* Secondary weapon fire
* Interactive triggers & events:
* Button trigger
* Area trigger
* Time trigger


## Gameplay:
Expand Down
55 changes: 40 additions & 15 deletions Server/assets/maps/ProjectDef.oep
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,6 @@
<ValueDefinitions />
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerArea" Limit="-1" ResizableX="true" ResizableY="true" Rotatable="false" RotateIncrement="15">
<Size>
<Width>64</Width>
<Height>64</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="255" G="0" B="0" />
</ImageDefinition>
<ValueDefinitions />
<NodesDefinition Enabled="true" Limit="-1" DrawMode="Fan" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="Platform" Limit="-1" ResizableX="false" ResizableY="false" Rotatable="false" RotateIncrement="15">
<Size>
<Width>64</Width>
Expand Down Expand Up @@ -289,5 +274,45 @@
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerTime" Limit="-1" ResizableX="false" ResizableY="false" Rotatable="false" RotateIncrement="15">
<Size>
<Width>16</Width>
<Height>16</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="255" G="128" B="64" />
</ImageDefinition>
<ValueDefinitions>
<ValueDefinition xsi:type="StringValueDefinition" Name="parent" Default="" MaxChars="-1" MultiLine="false" />
<ValueDefinition xsi:type="IntValueDefinition" Name="startInterval" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="IntValueDefinition" Name="interval" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="BoolValueDefinition" Name="doToggle" Default="false" />
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerArea" Limit="-1" ResizableX="true" ResizableY="true" Rotatable="false" RotateIncrement="15">
<Size>
<Width>16</Width>
<Height>16</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="0" G="255" B="0" />
</ImageDefinition>
<ValueDefinitions>
<ValueDefinition xsi:type="StringValueDefinition" Name="parent" Default="" MaxChars="-1" MultiLine="false" />
<ValueDefinition xsi:type="IntValueDefinition" Name="cooldown" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="BoolValueDefinition" Name="doToggle" Default="false" />
<ValueDefinition xsi:type="StringValueDefinition" Name="teams" Default="1111" MaxChars="-1" MultiLine="false" />
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
</EntityDefinitions>
</project>
1 change: 1 addition & 0 deletions Server/assets/maps/TwinCapture.oel
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,6 @@
<JumpPad id="17" x="1616" y="736" angle="0" />
<JumpPad id="18" x="1504" y="624" angle="180" />
<JumpPad id="19" x="640" y="624" angle="180" />
<TriggerArea id="20" x="416" y="400" width="144" height="64" parent="SysMeteor" cooldown="60" doToggle="False" teams="1111" />
</Entities>
</level>
Binary file modified Server/export/windows/cpp/bin/SkullRushServer.exe
Binary file not shown.
55 changes: 40 additions & 15 deletions Server/export/windows/cpp/bin/assets/maps/ProjectDef.oep
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,6 @@
<ValueDefinitions />
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerArea" Limit="-1" ResizableX="true" ResizableY="true" Rotatable="false" RotateIncrement="15">
<Size>
<Width>64</Width>
<Height>64</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="255" G="0" B="0" />
</ImageDefinition>
<ValueDefinitions />
<NodesDefinition Enabled="true" Limit="-1" DrawMode="Fan" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="Platform" Limit="-1" ResizableX="false" ResizableY="false" Rotatable="false" RotateIncrement="15">
<Size>
<Width>64</Width>
Expand Down Expand Up @@ -289,5 +274,45 @@
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerTime" Limit="-1" ResizableX="false" ResizableY="false" Rotatable="false" RotateIncrement="15">
<Size>
<Width>16</Width>
<Height>16</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="255" G="128" B="64" />
</ImageDefinition>
<ValueDefinitions>
<ValueDefinition xsi:type="StringValueDefinition" Name="parent" Default="" MaxChars="-1" MultiLine="false" />
<ValueDefinition xsi:type="IntValueDefinition" Name="startInterval" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="IntValueDefinition" Name="interval" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="BoolValueDefinition" Name="doToggle" Default="false" />
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
<EntityDefinition Name="TriggerArea" Limit="-1" ResizableX="true" ResizableY="true" Rotatable="false" RotateIncrement="15">
<Size>
<Width>16</Width>
<Height>16</Height>
</Size>
<Origin>
<X>0</X>
<Y>0</Y>
</Origin>
<ImageDefinition DrawMode="Rectangle" ImagePath="" Tiled="false">
<RectColor A="255" R="0" G="255" B="0" />
</ImageDefinition>
<ValueDefinitions>
<ValueDefinition xsi:type="StringValueDefinition" Name="parent" Default="" MaxChars="-1" MultiLine="false" />
<ValueDefinition xsi:type="IntValueDefinition" Name="cooldown" Default="0" Min="0" Max="1000" ShowSlider="true" />
<ValueDefinition xsi:type="BoolValueDefinition" Name="doToggle" Default="false" />
<ValueDefinition xsi:type="StringValueDefinition" Name="teams" Default="1111" MaxChars="-1" MultiLine="false" />
</ValueDefinitions>
<NodesDefinition Enabled="false" Limit="-1" DrawMode="None" Ghost="false" />
</EntityDefinition>
</EntityDefinitions>
</project>
1 change: 1 addition & 0 deletions Server/export/windows/cpp/bin/assets/maps/TwinCapture.oel
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,6 @@
<JumpPad id="17" x="1616" y="736" angle="0" />
<JumpPad id="18" x="1504" y="624" angle="180" />
<JumpPad id="19" x="640" y="624" angle="180" />
<TriggerArea id="20" x="416" y="400" width="144" height="64" parent="SysMeteor" cooldown="60" doToggle="False" teams="1111" />
</Entities>
</level>
Binary file modified Server/export/windows/cpp/bin/shared/images/minimaptile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Server/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class PlayState extends FlxState
Msg.MapMsg.data.set("mapstring", current_map_string);

OgmoLoader.initTilemaps();
OgmoLoader.initEntities();
OgmoLoader.loadXML(current_map_string, this);
MiniMap.loadXML(current_map_string, this);

Expand Down
62 changes: 62 additions & 0 deletions Server/source/entities/Trigger.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package entities;
import flixel.util.FlxTimer;
import plugins.BasePlugin;

/**
* ...
* @author ...
*/
class Trigger
{
public var parent:Dynamic;
public var ready:Bool = true;
public var cooldown:Int;

public function new(Parent:Dynamic, Cooldown:Int)
{
parent = Parent;

var parsed:Int = Std.parseInt(parent);
if (Std.parseInt(parent) != null)
parent = parsed;

cooldown = Cooldown;
}

public function toggle():Void
{
if (Std.is(parent, String))
{
var plugin:BasePlugin = cast Reg.plugins.get(cast parent);
plugin.working = !plugin.working;
}
else
{
var entity:Dynamic = OgmoLoader.entities.get(parent);

var entWorking:Bool = Reflect.getProperty(entity, "working");
Reflect.setProperty(entity, "working", !entWorking);
}

ready = false;
new FlxTimer(cooldown, function(T:FlxTimer) { ready = true; } );
}

public function activate():Void
{
if (Std.is(parent, String))
{
var plugin:BasePlugin = cast Reg.plugins.get(cast parent);
plugin.activate();
}
else
{
var entity:Dynamic = OgmoLoader.entities.get(parent);

Reflect.setProperty(entity, "working", true);
}

ready = false;
new FlxTimer(cooldown, function(T:FlxTimer) { ready = true; } );
}
}
104 changes: 104 additions & 0 deletions Server/source/entities/TriggerArea.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package entities;

import entities.TriggerArea.TriggerHitbox;
import flixel.FlxG;
import flixel.FlxSprite;
import haxe.xml.Fast;

/**
* ...
* @author ...
*/
class TriggerArea extends Trigger
{
public var teams:Array<Bool>;
public var doToggle:Bool;

public function new(Parent:Dynamic, Cooldown:Int, DoToggle:Bool, Teams:Array<Bool>,
X:Int, Y:Int, Width:Int, Height:Int)
{
teams = Teams;
doToggle = DoToggle;
super(Parent, Cooldown);

new TriggerHitbox(this, X, Y, Width, Height);
}

static public function makeFromXML(D:Fast):TriggerArea
{
var doToggle:Bool = false;
if (D.att.doToggle == "True")
doToggle = true;

var teams:Array<Bool> = [];
var teamtext:String = D.att.teams;

var t:Int = 0;
while (t < teamtext.length)
{
if (teamtext.charAt(t) == "1")
{
teams.push(true);
}

else
{
teams.push(false);
}

t++;
}

return new TriggerArea(D.att.parent,
Std.parseInt(D.att.cooldown),
doToggle,
teams,
Std.parseInt(D.att.x),
Std.parseInt(D.att.y),
Std.parseInt(D.att.width),
Std.parseInt(D.att.height));
}

static public function init():Void
{

}
}

class TriggerHitbox extends FlxSprite
{
public var trigger:TriggerArea;

public function new(Trig:TriggerArea, X:Int, Y:Int, Width:Int, Height:Int)
{
super(X, Y);
trigger = Trig;

makeGraphic(Width, Height, 0x00000000);

Reg.state.ent.add(this);
}

override public function update():Void
{
super.update();

for (p in Reg.server.playermap.iterator())
{
if (trigger.teams[p.team] == true)
{
if (FlxG.overlap(this, p) && trigger.ready)
{
if (trigger.doToggle)
{
trigger.toggle();
}
else
{
trigger.activate();
}
}
}
}
}
}
Loading

0 comments on commit b042f92

Please sign in to comment.