Skip to content

Commit

Permalink
Added networked arrow objective indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohmnivore committed Aug 22, 2014
1 parent 4659cae commit ac4b3df
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 3 deletions.
Binary file modified Client/export/windows/cpp/bin/SkullRush.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Client/export/windows/cpp/bin/manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aoy4:pathy34:assets%2Fdata%2Fdata-goes-here.txty4:typey4:TEXTy2:idR1goR0y29:assets%2Fgfx%2Fui%2Fpalma.pngR2y5:IMAGER4R5goR0y29:assets%2Fgfx%2Fui%2Fpalma.psdR2y6:BINARYR4R7goR0y30:assets%2Fgfx%2Fui%2Fpalma3.pngR2R6R4R9goR0y36:assets%2Fimages%2Fimages-go-here.txtR2R3R4R10goR0y31:assets%2Fimages_ui%2Fbutton.pngR2R6R4R11goR0y36:assets%2Fimages_ui%2Fbutton_thin.pngR2R6R4R12goR0y31:assets%2Fimages_ui%2Fchrome.pngR2R6R4R13goR0y28:assets%2Fimages_ui%2Ftab.pngR2R6R4R14goR0y33:assets%2Fimages_ui%2Ftab_back.pngR2R6R4R15goR0y17:assets%2Flogo.psdR2R8R4R16goR0y36:assets%2Fmusic%2Fmusic-goes-here.txtR2R3R4R17goR0y36:assets%2Fsounds%2Fsounds-go-here.txtR2R3R4R18goR0y30:assets%2Fxml%2Fempty_popup.xmlR2R3R4R19goR0y23:assets%2Fxml%2Fhome.xmlR2R3R4R20goR0y32:assets%2Fxml%2Fmessage_popup.xmlR2R3R4R21goR0y30:assets%2Fxml%2F_ui_globals.xmlR2R3R4R22goR0y32:shared%2Fimages%2Fbackground.pngR2R6R4R23goR0y34:shared%2Fimages%2Fbackground_s.pngR2R6R4R24goR0y27:shared%2Fimages%2Fblank.pngR2R6R4R25goR0y27:shared%2Fimages%2Fcrate.pngR2R6R4R26goR0y32:shared%2Fimages%2Fcrosshairs.pngR2R6R4R27goR0y33:shared%2Fimages%2Fcrosshairs2.pngR2R6R4R28goR0y39:shared%2Fimages%2Fexplosionparticle.pngR2R6R4R29goR0y28:shared%2Fimages%2Fflag_b.pngR2R6R4R30goR0y29:shared%2Fimages%2Fflag_bh.pngR2R6R4R31goR0y28:shared%2Fimages%2Fflag_g.pngR2R6R4R32goR0y29:shared%2Fimages%2Fflag_gh.pngR2R6R4R33goR0y28:shared%2Fimages%2Fflag_n.pngR2R6R4R34goR0y28:shared%2Fimages%2Fflag_r.pngR2R6R4R35goR0y29:shared%2Fimages%2Fflag_rh.pngR2R6R4R36goR0y28:shared%2Fimages%2Fflag_y.pngR2R6R4R37goR0y29:shared%2Fimages%2Fflag_yh.pngR2R6R4R38goR0y32:shared%2Fimages%2Fgridtiles2.pngR2R6R4R39goR0y32:shared%2Fimages%2Fgridtiles3.pngR2R6R4R40goR0y32:shared%2Fimages%2Fgridtiles4.pngR2R6R4R41goR0y25:shared%2Fimages%2Fgun.pngR2R6R4R42goR0y37:shared%2Fimages%2Fgun_eviscerator.pngR2R6R4R43goR0y44:shared%2Fimages%2Fgun_eviscerator_bullet.pngR2R6R4R44goR0y42:shared%2Fimages%2Fgun_eviscerator_icon.pngR2R6R4R45goR0y41:shared%2Fimages%2Fgun_launcher_bullet.pngR2R6R4R46goR0y39:shared%2Fimages%2Fgun_launcher_icon.pngR2R6R4R47goR0y37:shared%2Fimages%2Fgun_peacekeeper.pngR2R6R4R48goR0y44:shared%2Fimages%2Fgun_peacekeeper_bullet.pngR2R6R4R49goR0y42:shared%2Fimages%2Fgun_peacekeeper_icon.pngR2R6R4R50goR0y34:shared%2Fimages%2Fgun_splasher.pngR2R6R4R51goR0y41:shared%2Fimages%2Fgun_splasher_bullet.pngR2R6R4R52goR0y39:shared%2Fimages%2Fgun_splasher_icon.pngR2R6R4R53goR0y36:shared%2Fimages%2Findoor_tileset.pngR2R6R4R54goR0y30:shared%2Fimages%2Fjump_pad.pngR2R6R4R55goR0y32:shared%2Fimages%2Flaser_base.pngR2R6R4R56goR0y31:shared%2Fimages%2Fmeteorite.pngR2R6R4R57goR0y40:shared%2Fimages%2Fmeteorite_fragment.pngR2R6R4R58goR0y37:shared%2Fimages%2Foutdoor_tileset.pngR2R6R4R59goR0y30:shared%2Fimages%2Fplatform.pngR2R6R4R60goR0y32:shared%2Fimages%2Fplayerblue.pngR2R6R4R61goR0y33:shared%2Fimages%2Fplayergreen.pngR2R6R4R62goR0y31:shared%2Fimages%2Fplayerred.pngR2R6R4R63goR0y34:shared%2Fimages%2Fplayeryellow.pngR2R6R4R64goR0y36:shared%2Fimages%2Fpowerup_health.pngR2R6R4R65goR0y32:shared%2Fimages%2Fscifitiles.pngR2R6R4R66goR0y37:shared%2Fimages%2Fscifitiles_copy.pngR2R6R4R67goR0y27:shared%2Fimages%2Ftrail.pngR2R6R4R68goR0y34:shared%2Fimages%2Ftrigger_blue.pngR2R6R4R69goR0y35:shared%2Fimages%2Ftrigger_green.pngR2R6R4R70goR0y33:shared%2Fimages%2Ftrigger_red.pngR2R6R4R71goR0y39:shared%2Ftiledefs%2Findoor_tileset.jsonR2R3R4R72goR0y35:shared%2Ftiledefs%2FSkullSolid.tsetR2R3R4R73goR0y24:crashdumper%2F%2Fcpu.batR2R3R4R74goR0y24:crashdumper%2F%2Fgpu.batR2R3R4R75goR0y27:crashdumper%2F%2Fmemory.batR2R3R4R76goR0y23:crashdumper%2F%2Fos.batR2R3R4R77goR0y26:assets%2Fsounds%2Fbeep.oggR2y5:SOUNDR4R78goR0y28:assets%2Fsounds%2Fflixel.oggR2R79R4R80goR0y34:flixel%2Fflixel-ui%2Fimg%2Fbox.pngR2R6R4R81goR0y37:flixel%2Fflixel-ui%2Fimg%2Fbutton.pngR2R6R4R82goR0y48:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_down.pngR2R6R4R83goR0y48:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_left.pngR2R6R4R84goR0y49:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_right.pngR2R6R4R85goR0y46:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_up.pngR2R6R4R86goR0y42:flixel%2Fflixel-ui%2Fimg%2Fbutton_thin.pngR2R6R4R87goR0y44:flixel%2Fflixel-ui%2Fimg%2Fbutton_toggle.pngR2R6R4R88goR0y40:flixel%2Fflixel-ui%2Fimg%2Fcheck_box.pngR2R6R4R89goR0y41:flixel%2Fflixel-ui%2Fimg%2Fcheck_mark.pngR2R6R4R90goR0y37:flixel%2Fflixel-ui%2Fimg%2Fchrome.pngR2R6R4R91goR0y42:flixel%2Fflixel-ui%2Fimg%2Fchrome_flat.pngR2R6R4R92goR0y43:flixel%2Fflixel-ui%2Fimg%2Fchrome_inset.pngR2R6R4R93goR0y43:flixel%2Fflixel-ui%2Fimg%2Fchrome_light.pngR2R6R4R94goR0y44:flixel%2Fflixel-ui%2Fimg%2Fdropdown_mark.pngR2R6R4R95goR0y41:flixel%2Fflixel-ui%2Fimg%2Ffinger_big.pngR2R6R4R96goR0y43:flixel%2Fflixel-ui%2Fimg%2Ffinger_small.pngR2R6R4R97goR0y38:flixel%2Fflixel-ui%2Fimg%2Fhilight.pngR2R6R4R98goR0y36:flixel%2Fflixel-ui%2Fimg%2Finvis.pngR2R6R4R99goR0y41:flixel%2Fflixel-ui%2Fimg%2Fminus_mark.pngR2R6R4R100goR0y40:flixel%2Fflixel-ui%2Fimg%2Fplus_mark.pngR2R6R4R101goR0y36:flixel%2Fflixel-ui%2Fimg%2Fradio.pngR2R6R4R102goR0y40:flixel%2Fflixel-ui%2Fimg%2Fradio_dot.pngR2R6R4R103goR0y37:flixel%2Fflixel-ui%2Fimg%2Fswatch.pngR2R6R4R104goR0y34:flixel%2Fflixel-ui%2Fimg%2Ftab.pngR2R6R4R105goR0y39:flixel%2Fflixel-ui%2Fimg%2Ftab_back.pngR2R6R4R106goR0y39:flixel%2Fflixel-ui%2Fxml%2Fdefaults.xmlR2R3R4R107goR0y53:flixel%2Fflixel-ui%2Fxml%2Fdefault_loading_screen.xmlR2R3R4R108goR0y44:flixel%2Fflixel-ui%2Fxml%2Fdefault_popup.xmlR2R3R4R109gh
aoy4:pathy34:assets%2Fdata%2Fdata-goes-here.txty4:typey4:TEXTy2:idR1goR0y29:assets%2Fgfx%2Fui%2Fpalma.pngR2y5:IMAGER4R5goR0y29:assets%2Fgfx%2Fui%2Fpalma.psdR2y6:BINARYR4R7goR0y30:assets%2Fgfx%2Fui%2Fpalma3.pngR2R6R4R9goR0y36:assets%2Fimages%2Fimages-go-here.txtR2R3R4R10goR0y31:assets%2Fimages_ui%2Fbutton.pngR2R6R4R11goR0y36:assets%2Fimages_ui%2Fbutton_thin.pngR2R6R4R12goR0y31:assets%2Fimages_ui%2Fchrome.pngR2R6R4R13goR0y28:assets%2Fimages_ui%2Ftab.pngR2R6R4R14goR0y33:assets%2Fimages_ui%2Ftab_back.pngR2R6R4R15goR0y17:assets%2Flogo.psdR2R8R4R16goR0y36:assets%2Fmusic%2Fmusic-goes-here.txtR2R3R4R17goR0y36:assets%2Fsounds%2Fsounds-go-here.txtR2R3R4R18goR0y30:assets%2Fxml%2Fempty_popup.xmlR2R3R4R19goR0y23:assets%2Fxml%2Fhome.xmlR2R3R4R20goR0y32:assets%2Fxml%2Fmessage_popup.xmlR2R3R4R21goR0y30:assets%2Fxml%2F_ui_globals.xmlR2R3R4R22goR0y27:shared%2Fimages%2Farrow.pngR2R6R4R23goR0y28:shared%2Fimages%2Farrow2.pngR2R6R4R24goR0y32:shared%2Fimages%2Fbackground.pngR2R6R4R25goR0y34:shared%2Fimages%2Fbackground_s.pngR2R6R4R26goR0y27:shared%2Fimages%2Fblank.pngR2R6R4R27goR0y27:shared%2Fimages%2Fcrate.pngR2R6R4R28goR0y32:shared%2Fimages%2Fcrosshairs.pngR2R6R4R29goR0y33:shared%2Fimages%2Fcrosshairs2.pngR2R6R4R30goR0y39:shared%2Fimages%2Fexplosionparticle.pngR2R6R4R31goR0y28:shared%2Fimages%2Fflag_b.pngR2R6R4R32goR0y29:shared%2Fimages%2Fflag_bh.pngR2R6R4R33goR0y28:shared%2Fimages%2Fflag_g.pngR2R6R4R34goR0y29:shared%2Fimages%2Fflag_gh.pngR2R6R4R35goR0y28:shared%2Fimages%2Fflag_n.pngR2R6R4R36goR0y28:shared%2Fimages%2Fflag_r.pngR2R6R4R37goR0y29:shared%2Fimages%2Fflag_rh.pngR2R6R4R38goR0y28:shared%2Fimages%2Fflag_y.pngR2R6R4R39goR0y29:shared%2Fimages%2Fflag_yh.pngR2R6R4R40goR0y32:shared%2Fimages%2Fgridtiles2.pngR2R6R4R41goR0y32:shared%2Fimages%2Fgridtiles3.pngR2R6R4R42goR0y32:shared%2Fimages%2Fgridtiles4.pngR2R6R4R43goR0y25:shared%2Fimages%2Fgun.pngR2R6R4R44goR0y37:shared%2Fimages%2Fgun_eviscerator.pngR2R6R4R45goR0y44:shared%2Fimages%2Fgun_eviscerator_bullet.pngR2R6R4R46goR0y42:shared%2Fimages%2Fgun_eviscerator_icon.pngR2R6R4R47goR0y41:shared%2Fimages%2Fgun_launcher_bullet.pngR2R6R4R48goR0y39:shared%2Fimages%2Fgun_launcher_icon.pngR2R6R4R49goR0y37:shared%2Fimages%2Fgun_peacekeeper.pngR2R6R4R50goR0y44:shared%2Fimages%2Fgun_peacekeeper_bullet.pngR2R6R4R51goR0y42:shared%2Fimages%2Fgun_peacekeeper_icon.pngR2R6R4R52goR0y34:shared%2Fimages%2Fgun_splasher.pngR2R6R4R53goR0y41:shared%2Fimages%2Fgun_splasher_bullet.pngR2R6R4R54goR0y39:shared%2Fimages%2Fgun_splasher_icon.pngR2R6R4R55goR0y36:shared%2Fimages%2Findoor_tileset.pngR2R6R4R56goR0y30:shared%2Fimages%2Fjump_pad.pngR2R6R4R57goR0y32:shared%2Fimages%2Flaser_base.pngR2R6R4R58goR0y31:shared%2Fimages%2Fmeteorite.pngR2R6R4R59goR0y40:shared%2Fimages%2Fmeteorite_fragment.pngR2R6R4R60goR0y37:shared%2Fimages%2Foutdoor_tileset.pngR2R6R4R61goR0y30:shared%2Fimages%2Fplatform.pngR2R6R4R62goR0y32:shared%2Fimages%2Fplayerblue.pngR2R6R4R63goR0y33:shared%2Fimages%2Fplayergreen.pngR2R6R4R64goR0y31:shared%2Fimages%2Fplayerred.pngR2R6R4R65goR0y34:shared%2Fimages%2Fplayeryellow.pngR2R6R4R66goR0y36:shared%2Fimages%2Fpowerup_health.pngR2R6R4R67goR0y32:shared%2Fimages%2Fscifitiles.pngR2R6R4R68goR0y37:shared%2Fimages%2Fscifitiles_copy.pngR2R6R4R69goR0y27:shared%2Fimages%2Ftrail.pngR2R6R4R70goR0y34:shared%2Fimages%2Ftrigger_blue.pngR2R6R4R71goR0y35:shared%2Fimages%2Ftrigger_green.pngR2R6R4R72goR0y33:shared%2Fimages%2Ftrigger_red.pngR2R6R4R73goR0y39:shared%2Ftiledefs%2Findoor_tileset.jsonR2R3R4R74goR0y35:shared%2Ftiledefs%2FSkullSolid.tsetR2R3R4R75goR0y24:crashdumper%2F%2Fcpu.batR2R3R4R76goR0y24:crashdumper%2F%2Fgpu.batR2R3R4R77goR0y27:crashdumper%2F%2Fmemory.batR2R3R4R78goR0y23:crashdumper%2F%2Fos.batR2R3R4R79goR0y26:assets%2Fsounds%2Fbeep.oggR2y5:SOUNDR4R80goR0y28:assets%2Fsounds%2Fflixel.oggR2R81R4R82goR0y34:flixel%2Fflixel-ui%2Fimg%2Fbox.pngR2R6R4R83goR0y37:flixel%2Fflixel-ui%2Fimg%2Fbutton.pngR2R6R4R84goR0y48:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_down.pngR2R6R4R85goR0y48:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_left.pngR2R6R4R86goR0y49:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_right.pngR2R6R4R87goR0y46:flixel%2Fflixel-ui%2Fimg%2Fbutton_arrow_up.pngR2R6R4R88goR0y42:flixel%2Fflixel-ui%2Fimg%2Fbutton_thin.pngR2R6R4R89goR0y44:flixel%2Fflixel-ui%2Fimg%2Fbutton_toggle.pngR2R6R4R90goR0y40:flixel%2Fflixel-ui%2Fimg%2Fcheck_box.pngR2R6R4R91goR0y41:flixel%2Fflixel-ui%2Fimg%2Fcheck_mark.pngR2R6R4R92goR0y37:flixel%2Fflixel-ui%2Fimg%2Fchrome.pngR2R6R4R93goR0y42:flixel%2Fflixel-ui%2Fimg%2Fchrome_flat.pngR2R6R4R94goR0y43:flixel%2Fflixel-ui%2Fimg%2Fchrome_inset.pngR2R6R4R95goR0y43:flixel%2Fflixel-ui%2Fimg%2Fchrome_light.pngR2R6R4R96goR0y44:flixel%2Fflixel-ui%2Fimg%2Fdropdown_mark.pngR2R6R4R97goR0y41:flixel%2Fflixel-ui%2Fimg%2Ffinger_big.pngR2R6R4R98goR0y43:flixel%2Fflixel-ui%2Fimg%2Ffinger_small.pngR2R6R4R99goR0y38:flixel%2Fflixel-ui%2Fimg%2Fhilight.pngR2R6R4R100goR0y36:flixel%2Fflixel-ui%2Fimg%2Finvis.pngR2R6R4R101goR0y41:flixel%2Fflixel-ui%2Fimg%2Fminus_mark.pngR2R6R4R102goR0y40:flixel%2Fflixel-ui%2Fimg%2Fplus_mark.pngR2R6R4R103goR0y36:flixel%2Fflixel-ui%2Fimg%2Fradio.pngR2R6R4R104goR0y40:flixel%2Fflixel-ui%2Fimg%2Fradio_dot.pngR2R6R4R105goR0y37:flixel%2Fflixel-ui%2Fimg%2Fswatch.pngR2R6R4R106goR0y34:flixel%2Fflixel-ui%2Fimg%2Ftab.pngR2R6R4R107goR0y39:flixel%2Fflixel-ui%2Fimg%2Ftab_back.pngR2R6R4R108goR0y39:flixel%2Fflixel-ui%2Fxml%2Fdefaults.xmlR2R3R4R109goR0y53:flixel%2Fflixel-ui%2Fxml%2Fdefault_loading_screen.xmlR2R3R4R110goR0y44:flixel%2Fflixel-ui%2Fxml%2Fdefault_popup.xmlR2R3R4R111gh
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Client/source/SkullClient.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import haxe.io.BytesInput;
import haxe.Serializer;
import haxe.Unserializer;
import hxudp.UdpSocket;
import networkobj.NArrow;
import networkobj.NReg;
import networkobj.NScoreboard;
import networkobj.NTemplate;
Expand Down Expand Up @@ -682,6 +683,42 @@ class SkullClient extends Client
}
}

if (MsgID == Msg.ArrowNew.ID)
{
var ParentID:Int = Msg.ArrowNew.data.get("parentid");
var Color:Int = Msg.ArrowNew.data.get("color");

var a:NArrow = new NArrow(ParentID, Color);
NReg.arrows.set(ParentID, a);
}

if (MsgID == Msg.ArrowToggle.ID)
{
var ParentID:Int = Msg.ArrowToggle.data.get("parentid");
var On:Bool = Msg.ArrowToggle.data.get("on");

if (NReg.arrows.exists(ParentID))
{
var a:NArrow = NReg.arrows.get(ParentID);

a.on = On;
}
}

if (MsgID == Msg.ArrowDelete.ID)
{
var ParentID:Int = Msg.ArrowDelete.data.get("parentid");

if (NReg.arrows.exists(ParentID))
{
var a:NArrow = NReg.arrows.get(ParentID);

NReg.arrows.remove(ParentID);
a.kill();
a.destroy();
}
}

if (MsgID == Msg.AnnounceGuns.ID)
{
if (Reg.state.wepHUD != null)
Expand Down
70 changes: 70 additions & 0 deletions Client/source/networkobj/NArrow.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package networkobj;

import flixel.FlxSprite;
import flixel.tweens.misc.VarTween;
import flixel.util.FlxAngle;
import flixel.util.FlxMath;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;

/**
* ...
* @author ...
*/
class NArrow extends FlxSprite
{
public var parentID:Int;
public var on:Bool = true;

public function new(ParentID:Int, Color:Int):Void
{
super(0, 0, Assets.getImg("assets/images/arrow2.png"));

parentID = ParentID;
centerOrigin();
color = Color;
alpha = 0.5;

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

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

if (on)
{
if (NReg.sprites.exists(parentID) && Reg.state.player != null)
{
var sprite:FlxSprite = NReg.sprites.get(parentID);

if (FlxMath.distanceBetween(Reg.state.player, sprite) > 240)
{
if (alpha == 0)
FlxTween.tween(this, { alpha:0.5 }, 1,
{type:FlxTween.ONESHOT, ease:FlxEase.cubeIn});
var Angle:Float = FlxAngle.angleBetween(Reg.state.player, sprite, true);
var newPoint = FlxAngle.rotatePoint(100, 0, 0, 0, Angle);

x = newPoint.x + Reg.state.player.x;
y = newPoint.y + Reg.state.player.y;
angle = Angle;
}
else
{
if (alpha == 0.5)
FlxTween.tween(this, { alpha:0 }, 1,
{type:FlxTween.ONESHOT, ease:FlxEase.cubeIn});
}
}
}
else
{
if (alpha == 0.5)
{
FlxTween.tween(this, { alpha:0 }, 1,
{type:FlxTween.ONESHOT, ease:FlxEase.cubeIn});
}
}
}
}
2 changes: 2 additions & 0 deletions Client/source/networkobj/NReg.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class NReg
static public var sprites:Map<Int, FlxSprite>;
static public var emitters:Map<Int, FlxEmitterAuto>;
static public var live_emitters:Map<Int, FlxEmitterAuto>;
static public var arrows:Map<Int, NArrow>;

static public function init():Void
{
Expand All @@ -24,5 +25,6 @@ class NReg
sprites = new Map<Int, FlxSprite>();
emitters = new Map<Int, FlxEmitterAuto>();
live_emitters = new Map<Int, FlxEmitterAuto>();
arrows = new Map<Int, NArrow>();
}
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ At the moment the client source code is a mess. I'll clean it up one day.
## Engine:
* Animated networked sprites
* Improve game feel
* Objective arrow
* Minimap
* Bots -> maybe, just maybe
* Gadgets
Expand Down
Binary file modified Server/export/windows/cpp/bin/SkullRushServer.exe
Binary file not shown.
Loading

0 comments on commit ac4b3df

Please sign in to comment.