Skip to content

Commit

Permalink
remake level1 from scratch
Browse files Browse the repository at this point in the history
- way more playable and really shows off the engine nicely now
- new graphics that snap to the right widths/heights
- improve end user experience on map editor
- fix cutbars text, now displays correctly
- lots of minor fixes
  • Loading branch information
binary1230 committed Apr 25, 2017
1 parent 2f3bfcd commit 2b4b1a8
Show file tree
Hide file tree
Showing 30 changed files with 19,968 additions and 68 deletions.
2 changes: 2 additions & 0 deletions data/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
-->

<mode_file type="menu">menu.xml</mode_file>

<mode_file>level_0.xml</mode_file>
<mode_file>level_1.xml</mode_file>
<mode_file>level_2.xml</mode_file>
<mode_file>level_3.xml</mode_file>
Expand Down
19,459 changes: 19,459 additions & 0 deletions data/level_0.xml

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion data/level_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18328,10 +18328,15 @@
<item>common-effects.xml</item>
</m_included_effect_xml_files>
<m_included_objectdef_xml_files>
<count>2</count>
<count>7</count>
<item_version>0</item_version>
<item>common-objects.xml</item>
<item>objects-tropicalset.xml</item>
<item>objects/greenblock.xml</item>
<item>objects/spawner.xml</item>
<item>objects/enemy1.xml</item>
<item>objects/smallblock.xml</item>
<item>objects/block3.xml</item>
</m_included_objectdef_xml_files>
</this>
</boost_serialization>
Expand Down
22 changes: 13 additions & 9 deletions data/objects-tropicalset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@

<objectDefinitions>
<include_xml_file>objects/obj_background_night.xml</include_xml_file>
<include_xml_file>objects/greenblock.xml</include_xml_file>
<include_xml_file>objects/spawner.xml</include_xml_file>
<include_xml_file>objects/enemy1.xml</include_xml_file>
<include_xml_file>objects/smallblock.xml</include_xml_file>
<include_xml_file>objects/block3.xml</include_xml_file>

<include_xml_file>objects/tropical/block-large.xml</include_xml_file>
<include_xml_file>objects/tropical/block-large-evil.xml</include_xml_file>
<include_xml_file>objects/tropical/block-long.xml</include_xml_file>
<include_xml_file>objects/tropical/block-small.xml</include_xml_file>

<include_xml_file>objects/obj_s_palm_tall.xml</include_xml_file>
<include_xml_file>objects/flower1.xml</include_xml_file>
<include_xml_file>objects/flower2.xml</include_xml_file>

<include_xml_file>objects/fan.xml</include_xml_file>
<include_xml_file>objects/door.xml</include_xml_file>
<include_xml_file>objects/totem1.xml</include_xml_file>
<include_xml_file>objects/spring-up.xml</include_xml_file>
<include_xml_file>objects/spring-right.xml</include_xml_file>

<include_xml_file>objects/cloud.xml</include_xml_file>
<include_xml_file>objects/cloud2.xml</include_xml_file>
<include_xml_file>objects/door.xml</include_xml_file>

<include_xml_file>objects/sign-arrow.xml</include_xml_file>
<include_xml_file>objects/sign-arrow-up.xml</include_xml_file>
<include_xml_file>objects/sign-haha.xml</include_xml_file>
<include_xml_file>objects/sign-credits.xml</include_xml_file>
<include_xml_file>objects/sign-up.xml</include_xml_file>
<include_xml_file>objects/sign-leftright.xml</include_xml_file>
<include_xml_file>objects/sign-jump.xml</include_xml_file>
<include_xml_file>objects/totem1.xml</include_xml_file>
<include_xml_file>objects/spring-up.xml</include_xml_file>
<include_xml_file>objects/spring-right.xml</include_xml_file>
</objectDefinitions>
20 changes: 20 additions & 0 deletions data/objects/tropical/block-large-evil.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<objectDefinitions>

<objectDef name="block-large-evil" type="Static">
<animations default="default">
<animation name="default">
<frames>
<frame name="tropical/block-large-evil.png" duration="1" />
</frames>
<show_in_order />
<repeat />
</animation>
</animations>
<properties>
<solidObject />
</properties>
</objectDef>

</objectDefinitions>
20 changes: 20 additions & 0 deletions data/objects/tropical/block-large.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<objectDefinitions>

<objectDef name="block-large" type="Static">
<animations default="default">
<animation name="default">
<frames>
<frame name="tropical/block-large.png" duration="1" />
</frames>
<show_in_order />
<repeat />
</animation>
</animations>
<properties>
<solidObject />
</properties>
</objectDef>

</objectDefinitions>
20 changes: 20 additions & 0 deletions data/objects/tropical/block-long.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<objectDefinitions>

<objectDef name="block-long" type="Static">
<animations default="default">
<animation name="default">
<frames>
<frame name="tropical/block-long.png" duration="1" />
</frames>
<show_in_order />
<repeat />
</animation>
</animations>
<properties>
<solidObject />
</properties>
</objectDef>

</objectDefinitions>
20 changes: 20 additions & 0 deletions data/objects/tropical/block-small.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<objectDefinitions>

<objectDef name="block-small" type="Static">
<animations default="default">
<animation name="default">
<frames>
<frame name="tropical/block-small.png" duration="1" />
</frames>
<show_in_order />
<repeat />
</animation>
</animations>
<properties>
<solidObject />
</properties>
</objectDef>

</objectDefinitions>
77 changes: 77 additions & 0 deletions data/old/level_0-blank-oldformat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<gameMode type="simulation">
<info/>

<!--<luaScript>scripts/level1.lua</luaScript>TEMP-->

<properties>
<width>
16000
</width>
<height>
5000
</height>
<bgcolor>
<r>
27
</r>
<g>
45
</g>
<b>
135
</b>
</bgcolor>
<bgcolor_top>
<r>
0
</r>
<g>
0
</g>
<b>
0
</b>
</bgcolor_top>
</properties>
<objectDefinitions>
<!-- include the standard stuff -->
<include_xml_file>
common-objects.xml
</include_xml_file>
<include_xml_file>
objects-tropicalset.xml
</include_xml_file>
</objectDefinitions>
<effects>
<include_xml_file>
common-effects.xml
</include_xml_file>
</effects>
<map>
<layer scroll_speed="0.150000" name="background">
</layer>
<layer scroll_speed="1.000000" name="bg_objects">
</layer>
<layer scroll_speed="1.000000" name="foreground">
<object objectDef="amaya">
<position type="fixed">
<x>
0
</x>
<y>
60
</y>
</position>
<cameraFollow/>
<inputController>
1
</inputController>
</object>
</layer>
<layer scroll_speed="1.500000" name="foreground_fast">
</layer>
<layer scroll_speed="1.300000" name="overlays">
</layer>
</map>
</gameMode>
55 changes: 55 additions & 0 deletions data/scripts/level0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-- Level 1 - Treasure Island

introState = 1; -- to skip set to 9
done_intro = false;

function UpdateIntroState()
if done_intro then
return;
end

if introState == 1 then

music_play("bassy1.ogg");
-- world_play_input_script("data/input/level1.1.input");
world_textbox("Sup. It's a good day to be a sweet, sweet ninja.| |(Press C to continue)~I should meet up with my friend~I'll just head up from here.", "amaya-icon.png");


elseif introState == 2 then

world_create_cutbars("Pirates VS Ninjas|Level 1 - Treasure Island");

-- Now they can't go offscreen
world_allow_player_offscreen(0);

-- start the game for real.
done_intro = true;
music_play("level1.ogg");
end

introState = introState+1;
end

function Level_OnLoad()

if jumped_back_from_a_door() == 1 then
done_intro = true;
return
end

window_fadein(6);

-- until the cinematic is over, they can go offscreen
world_allow_player_offscreen(1);

UpdateIntroState();

end

function Input_DonePlaying()
UpdateIntroState();
end

function Textbox_Done()
UpdateIntroState();
end
Binary file added data/tropical/block-large-evil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/tropical/block-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/tropical/block-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/tropical/block-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion ninja-editor/GameWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public bool Init()
GameOptions options = GameOptions.GetInstance();

options.SetMapEditorEnabled(true);
options.SetFirstMode("level_1.xml");

// TODO: load from a file selector, don't just hardcode this here. woof.
// options.SetFirstMode("level_1.xml");
options.SetFirstMode("level_0.xml");


if (!game.Init(0, null))
return false;
Expand Down
26 changes: 26 additions & 0 deletions ninja-editor/ninja-engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@ public CollisionDirection() : this(enginePINVOKE.new_CollisionDirection(), true)

}

public enum VolatileStateLevel {
LEVEL_ITEMS,
LEVEL_PLAYERS
}

public class ObjectProperties : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
Expand Down Expand Up @@ -2049,6 +2054,10 @@ public bool ContainsPoint(SWIGTYPE_p_b2Vec2 p) {
return ret;
}

public virtual void ResetVolatileState(VolatileStateLevel level) {
enginePINVOKE.Object_ResetVolatileState(swigCPtr, (int)level);
}

public static Object AddPrototype(string type, Object obj) {
global::System.IntPtr cPtr = enginePINVOKE.Object_AddPrototype(type, Object.getCPtr(obj));
Object ret = (cPtr == global::System.IntPtr.Zero) ? null : new Object(cPtr, false);
Expand Down Expand Up @@ -2135,6 +2144,10 @@ public override void OnCollide(Object obj, SWIGTYPE_p_b2WorldManifold pkbWorldMa
enginePINVOKE.ObjectPlayer_OnCollide(swigCPtr, Object.getCPtr(obj), SWIGTYPE_p_b2WorldManifold.getCPtr(pkbWorldManifold));
}

public override void ResetVolatileState(VolatileStateLevel level) {
enginePINVOKE.ObjectPlayer_ResetVolatileState(swigCPtr, (int)level);
}

public override void OnAnimationLooped() {
enginePINVOKE.ObjectPlayer_OnAnimationLooped(swigCPtr);
}
Expand Down Expand Up @@ -2365,6 +2378,10 @@ public void NoModeUpdate() {
enginePINVOKE.Editor_NoModeUpdate(swigCPtr);
}

public void ResetVolatileLevelState(VolatileStateLevel level) {
enginePINVOKE.Editor_ResetVolatileLevelState(swigCPtr, (int)level);
}

public void UpdateMove() {
enginePINVOKE.Editor_UpdateMove(swigCPtr);
}
Expand Down Expand Up @@ -3521,6 +3538,9 @@ static enginePINVOKE() {
[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Object_ContainsPoint")]
public static extern bool Object_ContainsPoint(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Object_ResetVolatileState")]
public static extern void Object_ResetVolatileState(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Object_AddPrototype")]
public static extern global::System.IntPtr Object_AddPrototype(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);

Expand All @@ -3545,6 +3565,9 @@ static enginePINVOKE() {
[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_ObjectPlayer_OnCollide")]
public static extern void ObjectPlayer_OnCollide(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_ObjectPlayer_ResetVolatileState")]
public static extern void ObjectPlayer_ResetVolatileState(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_ObjectPlayer_OnAnimationLooped")]
public static extern void ObjectPlayer_OnAnimationLooped(global::System.Runtime.InteropServices.HandleRef jarg1);

Expand Down Expand Up @@ -3656,6 +3679,9 @@ static enginePINVOKE() {
[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Editor_NoModeUpdate")]
public static extern void Editor_NoModeUpdate(global::System.Runtime.InteropServices.HandleRef jarg1);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Editor_ResetVolatileLevelState")]
public static extern void Editor_ResetVolatileLevelState(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);

[global::System.Runtime.InteropServices.DllImport("ninja-engine.dll", EntryPoint="CSharp_Editor_UpdateMove")]
public static extern void Editor_UpdateMove(global::System.Runtime.InteropServices.HandleRef jarg1);

Expand Down
Loading

0 comments on commit 2b4b1a8

Please sign in to comment.