├── README.md ├── decbinhex ├── .README │ └── preview.png ├── README.md ├── default_env.tres ├── icon.png ├── icon.png.import ├── main.tscn ├── nakefile ├── nakefile.nim ├── nimlib.gdnlib ├── project.godot ├── scripts │ ├── main.gdns │ └── test_poly.gdns └── src │ ├── config.nims │ ├── convert.nim │ ├── main.nim │ ├── nim.cfg │ ├── stub.nim │ ├── stub.nimble │ └── test_poly.nim ├── dodgethenim ├── .import │ ├── House In a Forest Loop.ogg-8e554a1330e4ae364eda6047fe717533.oggstr │ ├── enemyFlyingAlt_1.png-e55523ede5c0e21ae63f4c282a8c2ca9.stex │ ├── enemyFlyingAlt_2.png-345c3e2dabbc0dee2d7136eb2bbb52cf.stex │ ├── enemySwimming_1.png-d188d6b80689d4f1cea218dec2a3ef25.stex │ ├── enemySwimming_2.png-8047fa43fe1eb727391543daa838e153.stex │ ├── enemyWalking_1.png-a388e49ab47a01f8e8fcecc60461315e.stex │ ├── enemyWalking_2.png-129eaca5d1fcaba01b5f5baac65e5955.stex │ ├── gameover.wav-944a3aa74701aafe6d87d1a40186f241.sample │ ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex │ ├── playerGrey_up1.png-aa8895b35bd9e91bc5c98c569f9960c9.stex │ ├── playerGrey_up2.png-03d4525fdaa671ce2c20dc82ceff4df1.stex │ ├── playerGrey_walk1.png-6e3683505061efbcedb14de666c244a8.stex │ └── playerGrey_walk2.png-ebc8a4a8e78075d773235e5ccdb763a6.stex ├── assets │ ├── fonts │ │ ├── FONTLOG.txt │ │ ├── LICENSE.txt │ │ └── Xolonium-Regular.ttf │ ├── sounds │ │ ├── House In a Forest Loop.ogg │ │ ├── House In a Forest Loop.ogg.import │ │ ├── gameover.wav │ │ └── gameover.wav.import │ └── sprites │ │ ├── enemyFlyingAlt_1.png │ │ ├── enemyFlyingAlt_1.png.import │ │ ├── enemyFlyingAlt_2.png │ │ ├── enemyFlyingAlt_2.png.import │ │ ├── enemySwimming_1.png │ │ ├── enemySwimming_1.png.import │ │ ├── enemySwimming_2.png │ │ ├── enemySwimming_2.png.import │ │ ├── enemyWalking_1.png │ │ ├── enemyWalking_1.png.import │ │ ├── enemyWalking_2.png │ │ ├── enemyWalking_2.png.import │ │ ├── playerGrey_up1.png │ │ ├── playerGrey_up1.png.import │ │ ├── playerGrey_up2.png │ │ ├── playerGrey_up2.png.import │ │ ├── playerGrey_walk1.png │ │ ├── playerGrey_walk1.png.import │ │ ├── playerGrey_walk2.png │ │ └── playerGrey_walk2.png.import ├── default_env.tres ├── icon.png ├── icon.png.import ├── nakefile.nim ├── nakefile.nim.cfg ├── nimlib.gdnlib ├── project.godot ├── scenes │ ├── Hud.tscn │ ├── Main.tscn │ ├── Mob.tscn │ └── Player.tscn ├── scripts │ ├── Hud.gdns │ ├── Main.gdns │ ├── Mob.gdns │ └── Player.gdns └── src │ ├── config.nims │ ├── hud.nim │ ├── main.nim │ ├── mob.nim │ ├── nim.cfg │ ├── player.nim │ ├── stub.nim │ └── stub.nimble └── nimway ├── .import ├── cell.png-81c2fb69d7e22398fca95d5a84080720.stex └── icon.png-487276ed1e3a0c39cad0279d744ee560.stex ├── default_env.tres ├── fonts └── Roboto │ ├── RobotoRegular.tres │ └── ttf │ ├── LICENSE.txt │ └── Roboto-Regular.ttf ├── icon.png ├── icon.png.import ├── nakefile.nim ├── nakefile.nim.cfg ├── nimlib.gdnlib ├── project.godot ├── scenes ├── Cell.tscn └── GameOfLife.tscn ├── scripts ├── Cell.gdns └── GoL.gdns ├── sprites ├── 9sii4k0j.bmp ├── cell.png └── cell.png.import └── src ├── cell.nim ├── config.nims ├── gol.nim ├── nim.cfg ├── stub.nim └── stub.nimble /README.md: -------------------------------------------------------------------------------- 1 | ## Nimified 'Dodge the Creeps' and 'Game of Life' 2 | 3 | For now only Dodge the Nim works fully on 1.0. This however should show you how a lot of things are done in godot-nim. 4 | 5 | NOTE: If you get a NilAccessError on the method `onMobTimerTimeout` please load the Mob scene in the editor on the Main Node. 6 | So select the Main node and in your Inspector you should see 'mob' as one of the script variables, load the Mob scene located in the `scenes` folder. You might have to restart your editor to see this after compiling the Nim source. And it might be gone after another restart. 7 | 8 | Most likely this is a Godot/GDNative thing, and you could do this using only code and not using a script variable per se. 9 | 10 | Make sure you have Godot(3.0+) and Nim(1.0+) and the [bindings](https://github.com/pragmagic/godot-nim) installed when you want to try these out. Run `nake build` in a samples directory to get started. 11 | Code isn't pretty as I'm still learning and I wrote this to orientate myself around both projects. 12 | 13 | Thanks to Skaruts for bringing the samples up to date for Nim 1.0 14 | 15 | ### TODO 16 | 17 | Add the sound effects and particles to the Dodge the Creeps project. 18 | FIX the nimway project to work on 1.0 19 | -------------------------------------------------------------------------------- /decbinhex/.README/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/decbinhex/.README/preview.png -------------------------------------------------------------------------------- /decbinhex/README.md: -------------------------------------------------------------------------------- 1 | # decbinhex 2 | 3 | ![preview](./.README/preview.png) 4 | 5 | Just a basic 2d application to convert decimal/binary/hexadecimal numbers. 6 | 7 | I used all newest stable stuff to make this. Godot 3.4, Nim 1.6.0, Godot-Nim 0.8.5* (note the stub.nimble usage of `requires "https://github.com/dsrw/godot-nim#f2af444"`, see https://github.com/pragmagic/godot-nim/pull/114). You also need to install tcc (Tiny C compiler) or go into `nim.cfg` and change the `--cc:tcc` option to use gcc or clang instead (tcc is much faster but I don't know about full capability for Godot... Clang isn't too bad for speed either). Otherwise, normal build process. 8 | 9 | Also there's a tiny bit of code (on the hidden polygon) for direct movement (local movement, rotation, also global movement commented out). No point yet but it should be helpful info on its own for actual simple games (and my next goal). 10 | 11 | Note that I'm a beginner with both Nim and Godot (this is part of my learning and hopefully will do more with Godot-Nim), feel free to give me advice (insomniac_lemon on Reddit), point out issues, or to simply fix any small technical mistakes/practices (can't say that I'll get it, but I'll look at the changes). 12 | -------------------------------------------------------------------------------- /decbinhex/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | radiance_size = 4 5 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 6 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 7 | sky_curve = 0.25 8 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 9 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 10 | ground_curve = 0.01 11 | sun_energy = 16.0 12 | 13 | [resource] 14 | background_mode = 2 15 | background_sky = SubResource( 1 ) 16 | ambient_light_sky_contribution = 0.0 17 | fog_height_min = 0.0 18 | fog_height_max = 100.0 19 | ssao_quality = 0 20 | ssao_blur = 1 21 | -------------------------------------------------------------------------------- /decbinhex/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/decbinhex/icon.png -------------------------------------------------------------------------------- /decbinhex/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /decbinhex/main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://scripts/test_poly.gdns" type="Script" id=1] 4 | [ext_resource path="res://scripts/main.gdns" type="Script" id=2] 5 | 6 | [sub_resource type="StyleBoxFlat" id=2] 7 | bg_color = Color( 0.329412, 0.32549, 0.32549, 1 ) 8 | border_width_left = 5 9 | border_width_top = 5 10 | border_width_right = 5 11 | border_width_bottom = 5 12 | border_color = Color( 1, 1, 1, 0 ) 13 | border_blend = true 14 | 15 | [sub_resource type="StyleBoxFlat" id=1] 16 | bg_color = Color( 0.0666667, 0.0666667, 0.0666667, 1 ) 17 | border_width_left = 5 18 | border_width_top = 2 19 | border_width_right = 5 20 | border_width_bottom = 10 21 | border_color = Color( 1, 1, 1, 1 ) 22 | border_blend = true 23 | corner_radius_top_left = 20 24 | corner_radius_top_right = 20 25 | corner_radius_bottom_right = 5 26 | corner_radius_bottom_left = 5 27 | corner_detail = 20 28 | shadow_size = 10 29 | 30 | [node name="main" type="Control"] 31 | anchor_right = 1.0 32 | anchor_bottom = 1.0 33 | rect_min_size = Vector2( 200, 100 ) 34 | size_flags_horizontal = 3 35 | size_flags_vertical = 3 36 | script = ExtResource( 2 ) 37 | __meta__ = { 38 | "_edit_use_anchors_": false 39 | } 40 | 41 | [node name="background" type="PanelContainer" parent="."] 42 | anchor_right = 1.0 43 | anchor_bottom = 1.0 44 | custom_styles/panel = SubResource( 2 ) 45 | __meta__ = { 46 | "_edit_use_anchors_": false 47 | } 48 | 49 | [node name="grid" type="GridContainer" parent="."] 50 | anchor_right = 1.0 51 | anchor_bottom = 1.0 52 | margin_left = 10.0 53 | margin_top = 10.0 54 | margin_right = -10.0 55 | margin_bottom = -10.0 56 | size_flags_horizontal = 3 57 | size_flags_vertical = 3 58 | __meta__ = { 59 | "_edit_use_anchors_": false 60 | } 61 | 62 | [node name="inbox" type="LineEdit" parent="grid"] 63 | margin_right = 305.0 64 | margin_bottom = 24.0 65 | size_flags_horizontal = 3 66 | clear_button_enabled = true 67 | placeholder_text = "input a number to convert" 68 | placeholder_alpha = 0.25 69 | __meta__ = { 70 | "_edit_use_anchors_": false 71 | } 72 | 73 | [node name="binary_check" type="CheckBox" parent="grid"] 74 | margin_top = 28.0 75 | margin_right = 305.0 76 | margin_bottom = 52.0 77 | text = "live binary-to-decimal" 78 | 79 | [node name="decimal_button" type="Button" parent="grid"] 80 | margin_top = 56.0 81 | margin_right = 305.0 82 | margin_bottom = 76.0 83 | disabled = true 84 | text = "Convert from decimal" 85 | 86 | [node name="binary_button" type="Button" parent="grid"] 87 | margin_top = 80.0 88 | margin_right = 305.0 89 | margin_bottom = 100.0 90 | disabled = true 91 | text = "Convert from binary" 92 | 93 | [node name="hex_button" type="Button" parent="grid"] 94 | margin_top = 104.0 95 | margin_right = 305.0 96 | margin_bottom = 124.0 97 | disabled = true 98 | text = "Convert from hexadecimal" 99 | 100 | [node name="a" type="PanelContainer" parent="grid"] 101 | show_behind_parent = true 102 | margin_top = 128.0 103 | margin_right = 305.0 104 | margin_bottom = 180.0 105 | size_flags_vertical = 3 106 | custom_styles/panel = SubResource( 1 ) 107 | __meta__ = { 108 | "_edit_use_anchors_": false 109 | } 110 | 111 | [node name="outlabel" type="Label" parent="grid/a"] 112 | margin_left = 5.0 113 | margin_top = 15.0 114 | margin_right = 300.0 115 | margin_bottom = 29.0 116 | size_flags_horizontal = 5 117 | size_flags_vertical = 6 118 | text = "Nothing converted yet." 119 | align = 1 120 | valign = 1 121 | autowrap = true 122 | __meta__ = { 123 | "_edit_use_anchors_": false 124 | } 125 | 126 | [node name="Node2D" type="Node2D" parent="."] 127 | visible = false 128 | 129 | [node name="test_poly" type="Polygon2D" parent="Node2D"] 130 | show_behind_parent = true 131 | position = Vector2( 281, 158 ) 132 | antialiased = true 133 | polygon = PoolVector2Array( 6.44888, 25.8345, -23.9066, 13.0829, -14.1984, -5.48203, -9.40036, -55.4309, -12.272, -185.442, -11.4312, -157.651, -10.4807, -150.155, -6.14691, -152.439, -4.12345, -148.937, -9.8105, -145.686, 9.48043, -145.523, -11.0174, -143.974, -9.00182, -77.3475, 11.5908, -13.8533, 20.6819, -8.20702 ) 134 | uv = PoolVector2Array( 7.94792, 65.5056, 20.1455, 34.9233, 38.8839, 44.2924, 88.9117, 48.1815, 218.849, 42.9466, 191.078, 44.2925, 183.601, 45.3791, 185.963, 49.6707, 182.498, 51.7575, 179.144, 46.1305, 179.332, 65.4212, 177.411, 44.9549, 110.832, 48.1815, 47.7227, 69.9251, 42.2426, 79.1174 ) 135 | vertex_colors = PoolColorArray( 1, 0, 0, 1, 0.00784314, 0, 1, 1, 1, 0.913725, 0, 1, 0, 0.882353, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.109804, 1, 1, 0.521569, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0.694118, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.501961, 1, 0, 1 ) 136 | script = ExtResource( 1 ) 137 | 138 | [connection signal="text_changed" from="grid/inbox" to="." method="on_inbox_text_changed"] 139 | [connection signal="pressed" from="grid/decimal_button" to="." method="submit_decimal"] 140 | [connection signal="pressed" from="grid/binary_button" to="." method="submit_binary"] 141 | [connection signal="pressed" from="grid/hex_button" to="." method="submit_hex"] 142 | -------------------------------------------------------------------------------- /decbinhex/nakefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/decbinhex/nakefile -------------------------------------------------------------------------------- /decbinhex/nakefile.nim: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Xored Software, Inc. 2 | 3 | import nake 4 | import os, ospaths, times 5 | import godotapigen 6 | 7 | proc genGodotApi() = 8 | let godotBin = getEnv("GODOT_BIN") 9 | if godotBin.len == 0: 10 | echo "GODOT_BIN environment variable is not set" 11 | quit(-1) 12 | if not fileExists(godotBin): 13 | echo "Invalid GODOT_BIN path: " & godotBin 14 | quit(-1) 15 | 16 | const targetDir = "src"/"godotapi" 17 | createDir(targetDir) 18 | const jsonFile = targetDir/"api.json" 19 | if not fileExists(jsonFile) or 20 | godotBin.getLastModificationTime() > jsonFile.getLastModificationTime(): 21 | direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile) 22 | if not fileExists(jsonFile): 23 | echo "Failed to generate api.json" 24 | quit(-1) 25 | 26 | genApi(targetDir, jsonFile) 27 | 28 | task "build", "Builds the client for the current platform": 29 | genGodotApi() 30 | let bitsPostfix = when sizeof(int) == 8: "_64" else: "_32" 31 | let libFile = 32 | when defined(windows): 33 | "nim" & bitsPostfix & ".dll" 34 | elif defined(ios): 35 | "nim_ios" & bitsPostfix & ".dylib" 36 | elif defined(macosx): 37 | "nim_mac.dylib" 38 | elif defined(android): 39 | "libnim_android.so" 40 | elif defined(linux): 41 | "nim_linux" & bitsPostfix & ".so" 42 | else: nil 43 | createDir("_dlls") 44 | withDir "src": 45 | direShell(["nimble", "c", ".."/"src"/"stub.nim", "-o:.."/"_dlls"/libFile]) 46 | 47 | task "clean", "Remove files produced by build": 48 | removeDir(".nimcache") 49 | removeDir("src"/".nimcache") 50 | removeDir("src"/"godotapi") 51 | removeDir("_dlls") 52 | removeFile("nakefile") 53 | removeFile("nakefile.exe") 54 | -------------------------------------------------------------------------------- /decbinhex/nimlib.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | X11.64="res://_dlls/nim_linux_64.so" 11 | X11.32="res://_dlls/nim_linux_32.so" 12 | Windows.64="res://_dlls/nim_64.dll" 13 | Windows.32="res://_dlls/nim_32.dll" 14 | OSX.64="res://_dlls/nim_mac.dylib" 15 | Android.armeabi-v7a="res://_dlls/armeabi-v7a/libnim_android.so" 16 | iOS.armv7="res://_dlls/nim_ios_32.a" 17 | iOS.arm64="res://_dlls/nim_ios_64.a" 18 | 19 | [dependencies] 20 | 21 | Windows.64=[ ] 22 | -------------------------------------------------------------------------------- /decbinhex/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | } 14 | 15 | [application] 16 | 17 | config/name="decbinhex" 18 | run/main_scene="res://main.tscn" 19 | config/icon="res://icon.png" 20 | 21 | [display] 22 | 23 | window/size/width=325 24 | window/size/height=200 25 | 26 | [gdnative] 27 | 28 | singletons=[ ] 29 | 30 | [rendering] 31 | 32 | environment/default_clear_color=Color( 0.301961, 0.301961, 0.301961, 0 ) 33 | quality/depth/hdr=false 34 | environment/default_environment="res://default_env.tres" 35 | -------------------------------------------------------------------------------- /decbinhex/scripts/main.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "main" 7 | class_name = "main" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /decbinhex/scripts/test_poly.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "test_poly" 7 | class_name = "test_poly" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /decbinhex/src/config.nims: -------------------------------------------------------------------------------- 1 | import ospaths 2 | 3 | switch("nimcache", ".nimcache"/hostOS/hostCPU) 4 | 5 | when defined(macosx): 6 | when defined(ios): 7 | if hostCPU == "arm64": 8 | switch("passC", "-arch arm64") 9 | switch("passL", "-arch arm64") 10 | elif hostCPU == "arm": 11 | switch("passC", "-arch armv7") 12 | switch("passL", "-arch armv7") 13 | switch("passC", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 14 | switch("passL", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 15 | else: 16 | switch("passL", "-framework Cocoa") 17 | elif defined(android): 18 | let ndk = getEnv("ANDROID_NDK_ROOT") 19 | let toolchain = getEnv("ANDROID_TOOLCHAIN") 20 | 21 | if ndk.len == 0: 22 | raise newException(OSError, 23 | "ANDROID_NDK_ROOT environment variable is necessary for android build") 24 | if toolchain.len == 0: 25 | raise newException(OSError, 26 | "ANDROID_TOOLCHAIN environment variable is necessary for android build") 27 | 28 | const level = $16 # change this to the necessary API level 29 | const arch = "arm" 30 | let sysroot = "--sysroot=\"" & ndk & "/platforms/android-" & level & "/arch-" & arch & "/\"" 31 | switch("passL", sysroot) 32 | switch("passC", sysroot) 33 | 34 | switch("cc", "clang") 35 | switch("arm.linux.clang.path", toolchain / "bin") 36 | switch("arm.linux.clang.exe", arch & "-linux-androideabi-clang") 37 | switch("arm.linux.clang.compilerexe", arch & "-linux-androideabi-clang") 38 | switch("arm.linux.clang.linkerexe", arch & "-linux-androideabi-clang") 39 | elif defined(windows): 40 | assert(sizeof(int) == 8) 41 | switch("cc", "vcc") 42 | elif defined(linux): 43 | switch("passC", "-fPIC") 44 | else: 45 | raise newException(OSError, "Unsupported platform: " & hostOS) 46 | 47 | when not defined(release): 48 | switch("debugger", "native") 49 | -------------------------------------------------------------------------------- /decbinhex/src/convert.nim: -------------------------------------------------------------------------------- 1 | import math, strutils 2 | 3 | # the asterisk is so it can be called from another file when imported 4 | proc convert_from_decimal*(input_decimal: string): string = 5 | var result_binary: string = "reset binary result" 6 | var result_hex: string = "reset hex result" 7 | if input_decimal.len < 20: result_binary = strip((parseInt( 8 | input_decimal)).toBin(63), trailing = false, chars = {'0'}) 9 | else: result_binary = "Output binary too large!" 10 | result_hex = strip(toHex(input_decimal.parseInt), trailing = false, chars = {'0'}) 11 | return("Binary is: " & result_binary & "\nHexadecimal is: " & result_hex) 12 | 13 | proc convert_from_binary*(input_binary: string): string = 14 | var result_decimal: int = 0 15 | var result_hex: string = "reset hex result" 16 | for i, c in input_binary: 17 | if c == '1': 18 | #use length to invert i... to get place without a decreasing variable 19 | result_decimal += 2^abs(i-(input_binary.len-1)) 20 | result_hex = strip(toHex(result_decimal), trailing = false, chars = {'0'}) 21 | return("Decimal is: " & $result_decimal & "\nHexadecimal is: " & result_hex) 22 | 23 | proc convert_from_hexadecimal*(input_hex: string): string = 24 | var lengthvar_hex: int = input_hex.len-1 25 | var result_binary: string = "reset binary result" 26 | var result_decimal: int = 0 27 | for c in input_hex: 28 | case c #the number at the end is an offset to the ASCII code 29 | of '0'..'9': result_decimal += (16^lengthvar_hex) * (int(c)-48) 30 | of 'a'..'f': result_decimal += (16^lengthvar_hex) * (int(c)-87) 31 | of 'A'..'F': result_decimal += (16^lengthvar_hex) * (int(c)-55) 32 | else: break 33 | lengthvar_hex -= 1 34 | result_binary = strip(result_decimal.toBin(63), leading = true, 35 | trailing = false, chars = {'0'}) 36 | return("Decimal is: " & $result_decimal & "\nBinary is: " & result_binary) 37 | -------------------------------------------------------------------------------- /decbinhex/src/main.nim: -------------------------------------------------------------------------------- 1 | import godot, strutils 2 | import godotapi / [gd_os, node_2d, engine, input, control, scene_tree, 3 | line_edit, base_button, label] 4 | import convert 5 | 6 | let 7 | hex_letters: set[char] = HexDigits - Digits 8 | nonhex_chars: set[char] = AllChars - HexDigits 9 | nonbinary_numbers: set[char] = Digits - {'0', '1'} 10 | 11 | gdobj main of Control: 12 | 13 | method ready*() = 14 | gd_os.set_min_window_size(vec2(325, 200)) 15 | gd_os.set_max_window_size(vec2(960, 240)) 16 | print "ready" 17 | 18 | proc disable_all_buttons(message: string) = 19 | self.getNode("grid/decimal_button").BaseButton.disabled = true 20 | self.getNode("grid/binary_button").BaseButton.disabled = true 21 | self.getNode("grid/hex_button").BaseButton.disabled = true 22 | self.getNode("grid/a/outlabel").Label.text = message 23 | 24 | # note the default signal name here but with leading underscore removed (edited signal name in Godot editor too!) 25 | # that is needed, otherwise it won't compile 26 | # Also gdExport pragma seems needed for signals to function properly 27 | proc on_inbox_text_changed(intext: string) {.gdExport.} = 28 | #print intext.len 29 | if nonhex_chars in intext or intext.len == 0: 30 | #Important! any proc called that also needs to deal with nodes will error if not called with self 31 | #(or self as a parameter, but that looks odd since it's not+cannot be defined as an argument) 32 | self.disable_all_buttons("Waiting for valid input.") 33 | return 34 | if intext.len > 63: 35 | self.disable_all_buttons("Input too large, causes overflow!") 36 | return 37 | self.getNode("grid/a/outlabel").Label.text = "Waiting for button choice." 38 | self.getNode("grid/hex_button").BaseButton.disabled = false 39 | if intext.len > 15: 40 | self.getNode("grid/hex_button").BaseButton.disabled = true 41 | if hex_letters in intext: 42 | self.getNode("grid/decimal_button").BaseButton.disabled = true 43 | self.getNode("grid/binary_button").BaseButton.disabled = true 44 | self.getNode("grid/a/outlabel").Label.text = "Input hexadecimal too large, causes overflow!" 45 | return 46 | if hex_letters in intext: 47 | self.getNode("grid/decimal_button").BaseButton.disabled = true 48 | self.getNode("grid/binary_button").BaseButton.disabled = true 49 | self.getNode("grid/a/outlabel").Label.text = ("Live hexadecimal conversion is:\n" & $intext.parseHexInt & " in decimal") 50 | return 51 | if intext.len < 20 and parseInt(intext) == 0: 52 | self.disable_all_buttons("Waiting for valid input.") 53 | return 54 | if nonbinary_numbers in intext: 55 | self.getNode("grid/binary_button").BaseButton.disabled = true 56 | self.getNode("grid/decimal_button").BaseButton.disabled = false 57 | else: 58 | self.getNode("grid/binary_button").BaseButton.disabled = false 59 | self.getNode("grid/decimal_button").BaseButton.disabled = false 60 | if (self.getNode("grid/binary_check").BaseButton).is_pressed: 61 | if intext.len < 20: 62 | self.getNode("grid/a/outlabel").Label.text = ("Live binary conversion is:\n" & $intext.parseBinInt & " in decimal") 63 | else: self.getNode("grid/a/outlabel").Label.text = ("Input decimal too large to parse for live convert, please use button") 64 | 65 | proc submit_decimal() {.gdExport.} = 66 | #called proc is imported from convert.nim 67 | self.getNode("grid/a/outlabel").Label.text = convert_from_decimal(self.getNode("grid/inbox").LineEdit.text) 68 | 69 | proc submit_binary() {.gdExport.} = 70 | self.getNode("grid/a/outlabel").Label.text = convert_from_binary(self.getNode("grid/inbox").LineEdit.text) 71 | 72 | proc submit_hex() {.gdExport.} = 73 | self.getNode("grid/a/outlabel").Label.text = convert_from_hexadecimal( 74 | self.getNode("grid/inbox").LineEdit.text) 75 | 76 | method process*(delta: float64) = discard 77 | -------------------------------------------------------------------------------- /decbinhex/src/nim.cfg: -------------------------------------------------------------------------------- 1 | --cc:tcc 2 | --path:"$projectdir" 3 | --app:lib 4 | -d:useRealtimeGc 5 | --noMain 6 | --warning[LockLevel]:off 7 | -------------------------------------------------------------------------------- /decbinhex/src/stub.nim: -------------------------------------------------------------------------------- 1 | when not defined(release): 2 | import segfaults # converts segfaults into NilAccessError 3 | {.push warnings: off.} 4 | import test_poly 5 | import main 6 | -------------------------------------------------------------------------------- /decbinhex/src/stub.nimble: -------------------------------------------------------------------------------- 1 | version = "0.1.0" 2 | author = "Xored Software, Inc." 3 | description = "Godot-Nim Project Stub" 4 | license = "MIT" 5 | 6 | requires "https://github.com/dsrw/godot-nim#f2af444" 7 | #requires "godot-nim 0.8.6" .6? PR #114 must be merged 8 | -------------------------------------------------------------------------------- /decbinhex/src/test_poly.nim: -------------------------------------------------------------------------------- 1 | import godot 2 | import godotapi / [engine, polygon_2d, node_2d, input, control, canvas_item, scene_tree] 3 | 4 | gdobj test_poly of Node2d: 5 | 6 | proc start*(pos: Vector2) = discard 7 | 8 | method ready*() = print("present") 9 | #discard 10 | 11 | #tank movement 12 | method process*(delta: float64) = 13 | #global movement commented out 14 | #if isActionPressed("ui_right"): self.editSetPosition(vec2(self.editGetPosition.x + 1.0'f32, self.editGetPosition.y + 0.0'f32)) 15 | if isActionPressed("ui_up"): self.moveLocalY(-1.0) 16 | elif isActionPressed("ui_up"): self.moveLocalY(+1.0) 17 | if isActionPressed("ui_right"): self.editSetRotation(self.editGetRotation + 0.01'f64) 18 | elif isActionPressed("ui_left"): self.editSetRotation(self.editGetRotation - 0.01'f64) 19 | -------------------------------------------------------------------------------- /dodgethenim/.import/House In a Forest Loop.ogg-8e554a1330e4ae364eda6047fe717533.oggstr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/House In a Forest Loop.ogg-8e554a1330e4ae364eda6047fe717533.oggstr -------------------------------------------------------------------------------- /dodgethenim/.import/enemyFlyingAlt_1.png-e55523ede5c0e21ae63f4c282a8c2ca9.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemyFlyingAlt_1.png-e55523ede5c0e21ae63f4c282a8c2ca9.stex -------------------------------------------------------------------------------- /dodgethenim/.import/enemyFlyingAlt_2.png-345c3e2dabbc0dee2d7136eb2bbb52cf.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemyFlyingAlt_2.png-345c3e2dabbc0dee2d7136eb2bbb52cf.stex -------------------------------------------------------------------------------- /dodgethenim/.import/enemySwimming_1.png-d188d6b80689d4f1cea218dec2a3ef25.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemySwimming_1.png-d188d6b80689d4f1cea218dec2a3ef25.stex -------------------------------------------------------------------------------- /dodgethenim/.import/enemySwimming_2.png-8047fa43fe1eb727391543daa838e153.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemySwimming_2.png-8047fa43fe1eb727391543daa838e153.stex -------------------------------------------------------------------------------- /dodgethenim/.import/enemyWalking_1.png-a388e49ab47a01f8e8fcecc60461315e.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemyWalking_1.png-a388e49ab47a01f8e8fcecc60461315e.stex -------------------------------------------------------------------------------- /dodgethenim/.import/enemyWalking_2.png-129eaca5d1fcaba01b5f5baac65e5955.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/enemyWalking_2.png-129eaca5d1fcaba01b5f5baac65e5955.stex -------------------------------------------------------------------------------- /dodgethenim/.import/gameover.wav-944a3aa74701aafe6d87d1a40186f241.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/gameover.wav-944a3aa74701aafe6d87d1a40186f241.sample -------------------------------------------------------------------------------- /dodgethenim/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /dodgethenim/.import/playerGrey_up1.png-aa8895b35bd9e91bc5c98c569f9960c9.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/playerGrey_up1.png-aa8895b35bd9e91bc5c98c569f9960c9.stex -------------------------------------------------------------------------------- /dodgethenim/.import/playerGrey_up2.png-03d4525fdaa671ce2c20dc82ceff4df1.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/playerGrey_up2.png-03d4525fdaa671ce2c20dc82ceff4df1.stex -------------------------------------------------------------------------------- /dodgethenim/.import/playerGrey_walk1.png-6e3683505061efbcedb14de666c244a8.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/playerGrey_walk1.png-6e3683505061efbcedb14de666c244a8.stex -------------------------------------------------------------------------------- /dodgethenim/.import/playerGrey_walk2.png-ebc8a4a8e78075d773235e5ccdb763a6.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/.import/playerGrey_walk2.png-ebc8a4a8e78075d773235e5ccdb763a6.stex -------------------------------------------------------------------------------- /dodgethenim/assets/fonts/FONTLOG.txt: -------------------------------------------------------------------------------- 1 | Please distribute this file along with the Xolonium fonts when possible. 2 | 3 | 4 | Source 5 | 6 | Find the sourcefiles of Xolonium at 7 | 8 | 9 | 10 | Credits 11 | 12 | Xolonium is created with FontForge , 13 | Inkscape , Python , and 14 | FontTools . 15 | 16 | It originated as a custom font for the open-source 17 | game Xonotic . With many thanks to the 18 | Xonotic community for your support. 19 | 20 | 21 | Supported OpenType features 22 | 23 | case Provides case sensitive placement of punctuation, 24 | brackets, and math symbols for uppercase text. 25 | frac Replaces number/number sequences with diagonal fractions. 26 | Numbers that touch a slash should not exceed 10 digits. 27 | kern Provides kerning for Latin, Greek, and Cyrillic scripts. 28 | locl Dutch: Replaces j with a stressed version if it follows í. 29 | Sami: Replaces n-form Eng with the preferred N-form version. 30 | Romanian and Moldovan: Replaces ŞşŢţ with the preferred ȘșȚț. 31 | pnum Replaces monospaced digits with proportional versions. 32 | sinf Replaces digits with scientific inferiors below the baseline. 33 | subs Replaces digits with subscript versions on the baseline. 34 | sups Replaces digits with superscript versions. 35 | zero Replaces zero with a slashed version. 36 | 37 | 38 | Supported glyph sets 39 | 40 | Adobe Latin 3 41 | OpenType W1G 42 | ISO 8859-1 Western European 43 | ISO 8859-2 Central European 44 | ISO 8859-3 South European 45 | ISO 8859-4 North European 46 | ISO 8859-5 Cyrillic 47 | ISO 8859-7 Greek 48 | ISO 8859-9 Turkish 49 | ISO 8859-10 Nordic 50 | ISO 8859-13 Baltic Rim 51 | ISO 8859-14 Celtic 52 | ISO 8859-15 Western European 53 | ISO 8859-16 South-Eastern European 54 | 55 | 56 | Available glyphs 57 | 58 | !"#$%&'()*+,-./0123456789:;<=>? 59 | @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ 60 | `abcdefghijklmnopqrstuvwxyz{|}~ 61 | 62 |  ¡¢£¤¥¦§¨©ª«¬ ®¯°±²³´µ¶·¸¹º»¼½¾¿ 63 | ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß 64 | àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 65 | ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğ 66 | ĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľ 67 | ĿŀŁłŃńŅņŇňŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞş 68 | ŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž 69 | ƒǺǻǼǽǾǿȘșȚțȷ 70 | 71 | ˆˇˉ˘˙˚˛˜˝ 72 | 73 | ͺ;΄΅Ά·ΈΉΊΌΎΏΐ 74 | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫάέήίΰ 75 | αβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ 76 | 77 | ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОП 78 | РСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп 79 | рстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџ 80 | ѢѣѲѳѴѵҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠҡҢңҤҥҦҧҨҩ 81 | ҪҫҬҭҮүҰұҲҳҴҵҶҷҸҹҺһҼҽӀӁӂӇӈӋӌӏӐӑӒӓ 82 | ӔӕӖӗӘәӜӝӞӟӠӡӢӣӤӥӦӧӨөӮӯӰӱӲӳӴӵӶӷӸӹ 83 | Ԥԥ 84 | 85 | ḂḃḊḋḞḟṀṁṖṗṠṡṪṫẀẁẂẃẄẅẞỲỳ 86 | 87 |      ‒–—―‘’‚‛“”„‟†‡•…‰′″‹›‽‾⁄ 88 | ⁰⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿ₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎ 89 | ₤₦₩₫€₯₱₹₺₽₿ 90 | ℅ℓ№℗™Ω℮ 91 | ⅛⅜⅝⅞ 92 | ←↑→↓ 93 | ∂∆∏∑−∕∙√∞∟∫≈≠≤≥ 94 | ⌖ 95 | ■▬▮▰▲▶▼◀◆◊●◢◣◤◥ 96 | ☄★☠☢☣⚙⚛⚠⚡⛔ 97 | ❇❈❌❤❰❱❲❳ 98 | fffiflffiffl 99 | 🌌🌍🌎🌏👽💣🔥🔫 100 | 😁😃😄😆😇😈😉😊😎😐😒😕😘 101 | 😛😝😞😟😠😣😭😮😲😴😵 102 | 🚀 103 | 104 | 105 | Debugging glyphs 106 | 107 |  U+EFFD Font version 108 |  U+F000 Font hinting indicator 109 | 110 | 111 | Changelog 112 | 113 | Xolonium 4.1 2016-11-22 Severin Meyer 114 | Reverted frac OpenType feature to a more stable implementation 115 | 116 | Xolonium 4.0 2016-10-08 Severin Meyer 117 | Decreased width of most glyphs 118 | Thinner vertical stems in Xolonium-Regular 119 | Thicker horizontal stems in Xolonium-Bold 120 | Revised diagonal stems 121 | Lowered middle bars 122 | Revised diacritical bars 123 | Added glyphs: 124 | ӏẞ₿ 125 | U+2007 U+2008 U+2009 U+200A U+202F 126 | U+EFFD U+F000 127 | Revised glyphs: 128 | $&,JKQRXkwxy~¢¤ßǻ˜ζκλμξφЖУжћѴѵ∕₱₺₦₩€ℓ№≈ffffiffl 129 | ❤🌍🌎🌏😁😄😇😈😉😊😘😭😮😴🚀 130 | Removed uncommon glyphs: 131 | ʼnſʼҌҍҎҏҾҿӃӄӇӈӚӛӪӫӬӭ 132 | U+0312 U+0313 U+0326 133 | Simplified OpenType features pnum, zero, and case 134 | Removed OpenType feature dlig 135 | Revised vertical metrics 136 | Merged outlines of composite glyphs in otf version 137 | Added ttf version with custom outlines and instructions 138 | Added woff and woff2 version 139 | 140 | Xolonium 3.1 2015-06-10 Severin Meyer 141 | Added currency glyphs: 142 | ₦₩₫₱₹₺₽ 143 | Revised glyph: 144 | ₯ 145 | Relicensed public release under the SIL Open Font License 1.1 146 | 147 | Xolonium 3.0 2015-05-04 Severin Meyer 148 | Decreased width of glyphs 149 | Decreased descender height 150 | Increased height of super/subscript glyphs 151 | Revised width of dashes, underscore, and overscore 152 | Sharper bends with more circular proportions 153 | Decreased stroke thickness of mathematical glyphs 154 | Revised diacritical marks 155 | Revised diacritical bars 156 | Revised Cyrillic hooks 157 | Revised glyphs: 158 | GQRYjmuwßŊŒſƒǻfffiffiffl 159 | ΞΨΩδζιξπςστυφω 160 | ЉЄДЛУЭЯбдлэяєљђєћѢѣҨҩҼҽӃӄӘә 161 | #$&'()*,/69?@[]{}~¡£¤¥§©®¿ 162 | ‹›₤€₯ℓ№℗℮←↑→↓∂∏∑∞≈▰☄❈❰❱❲❳😝 163 | Raised vertical position of mathematical glyphs 164 | Unified advance width of numeral and monetary glyphs 165 | Unified advance width of mathematical glyphs 166 | Revised bearings 167 | Rewrote kern feature 168 | Bolder Xolonium-Bold with improved proportions 169 | Updated glyph names to conform to the AGLFN 1.7 170 | Revised hints and PS Private Dictionary 171 | Added glyphs: 172 | ӶӷԤԥ 173 | Added OpenType features: 174 | case frac liga locl pnum sinf subs sups zero 175 | 176 | Xolonium 2.4 2014-12-23 Severin Meyer 177 | Added dingbats: 178 | ⛔💣🔥 179 | Revised size and design of emoticons 180 | Revised dingbats: 181 | ⌖☄☠☣⚙⚛⚠⚡❇❈🌌🌍🌎🌏🔫 182 | Removed dingbat: 183 | 💥 184 | 185 | Xolonium 2.3 2014-08-14 Severin Meyer 186 | Bugfixed ε and έ, thanks to bowzee for the feedback 187 | 188 | Xolonium 2.2 2014-03-01 Severin Meyer 189 | Added dingbats: 190 | ⌖◆●❌💥 191 | Revised dingbats: 192 | •←↑→↓◊☄★☠☣⚙⚛⚠⚡❇❈❤🌌🌍🌎🌏👽🔫🚀 193 | Removed dingbats: 194 | ♻✪💡📡🔋🔧🔭 195 | 196 | Xolonium 2.1 2013-10-20 Severin Meyer 197 | Added dingbats: 198 | ←↑→↓❰❱❲❳■▬▮▰▲▶▼◀◢◣◤◥ 199 | ☄★☠☢☣♻⚙⚛⚠⚡✪❇❈❤ 200 | 🌌🌍🌎🌏👽💡📡🔋🔧🔫🔭🚀 201 | 😁😃😄😆😇😈😉😊😎😐😒😕 202 | 😘😛😝😞😟😠😣😭😮😲😴😵 203 | 204 | Xolonium 2.0.1 2013-07-12 Severin Meyer 205 | Reorganised and simplified files 206 | 207 | Xolonium 2.0 2012-08-11 Severin Meyer 208 | Revised bends 209 | Revised thickness of uppercase diagonal stems 210 | Revised diacritical marks 211 | Revised hints and PS Private Dictionary 212 | Revised glyphs: 213 | *1469@DPRly{}§©®¶ÐÞƒΘΞαεζνξνυЄЉЊ 214 | ЏБЗЛУЧЪЫЬЭЯбзлчъыьэяєљњџ•€∂∙√∞∫≠ 215 | Completed glyph sets: 216 | Adobe Latin 3 217 | OpenType World Glyph Set 1 (W1G) 218 | Ghostscript Standard (ghostscript-fonts-std-8.11) 219 | Added OpenType kern feature 220 | Added Xolonium-Bold 221 | 222 | Xolonium 1.2 2011-02-12 Severin Meyer 223 | Revised glyphs: 224 | D·Ðı 225 | Completed glyph sets: 226 | ISO 8859-7 (Greek) 227 | Unicode Latin Extended-A block 228 | Added glyphs: 229 | †‡•…‰⁄™∂∑−√∞≠≤≥ 230 | 231 | Xolonium 1.1 2011-01-17 Severin Meyer 232 | Revised placement of cedilla and ogonek in accented glyphs 233 | Revised glyphs: 234 | ,;DKTjkvwxy¥§Ð˛€ 235 | Completed glyph sets: 236 | ISO 8859-2 (Central European) 237 | ISO 8859-3 (South European, Esperanto) 238 | ISO 8859-4 (North European) 239 | ISO 8859-5 (Cyrillic) 240 | ISO 8859-9 (Turkish) 241 | ISO 8859-10 (Nordic) 242 | ISO 8859-13 (Baltic Rim) 243 | ISO 8859-14 (Celtic) 244 | ISO 8859-16 (South-Eastern European) 245 | Added glyphs: 246 | ȷʼ̒ ЀЍѐѝ‒–—‘’‚‛“”„‟‹› 247 | 248 | Xolonium 1.0 2011-01-04 Severin Meyer 249 | Completed glyph sets: 250 | ISO 8859-1 (Western European) 251 | ISO 8859-15 (Western European) 252 | Added glyphs: 253 | ĄĆĘŁŃŚŹŻąćęłńśźżıˆˇ˙˚˛˜ 254 | -------------------------------------------------------------------------------- /dodgethenim/assets/fonts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Severin Meyer , 2 | with Reserved Font Name Xolonium. 3 | 4 | This Font Software is licensed under the SIL Open Font License, 5 | Version 1.1. This license is copied below, and is also available 6 | with a FAQ at 7 | 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide 15 | development of collaborative font projects, to support the font creation 16 | efforts of academic and linguistic communities, and to provide a free and 17 | open framework in which fonts may be shared and improved in partnership 18 | with others. 19 | 20 | The OFL allows the licensed fonts to be used, studied, modified and 21 | redistributed freely as long as they are not sold by themselves. The 22 | fonts, including any derivative works, can be bundled, embedded, 23 | redistributed and/or sold with any software provided that any reserved 24 | names are not used by derivative works. The fonts and derivatives, 25 | however, cannot be released under any other type of license. The 26 | requirement for fonts to remain under this license does not apply 27 | to any document created using the fonts or their derivatives. 28 | 29 | DEFINITIONS 30 | "Font Software" refers to the set of files released by the Copyright 31 | Holder(s) under this license and clearly marked as such. This may 32 | include source files, build scripts and documentation. 33 | 34 | "Reserved Font Name" refers to any names specified as such after the 35 | copyright statement(s). 36 | 37 | "Original Version" refers to the collection of Font Software components as 38 | distributed by the Copyright Holder(s). 39 | 40 | "Modified Version" refers to any derivative made by adding to, deleting, 41 | or substituting -- in part or in whole -- any of the components of the 42 | Original Version, by changing formats or by porting the Font Software to a 43 | new environment. 44 | 45 | "Author" refers to any designer, engineer, programmer, technical 46 | writer or other person who contributed to the Font Software. 47 | 48 | PERMISSION & CONDITIONS 49 | Permission is hereby granted, free of charge, to any person obtaining 50 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 51 | redistribute, and sell modified and unmodified copies of the Font 52 | Software, subject to the following conditions: 53 | 54 | 1) Neither the Font Software nor any of its individual components, 55 | in Original or Modified Versions, may be sold by itself. 56 | 57 | 2) Original or Modified Versions of the Font Software may be bundled, 58 | redistributed and/or sold with any software, provided that each copy 59 | contains the above copyright notice and this license. These can be 60 | included either as stand-alone text files, human-readable headers or 61 | in the appropriate machine-readable metadata fields within text or 62 | binary files as long as those fields can be easily viewed by the user. 63 | 64 | 3) No Modified Version of the Font Software may use the Reserved Font 65 | Name(s) unless explicit written permission is granted by the corresponding 66 | Copyright Holder. This restriction only applies to the primary font name as 67 | presented to the users. 68 | 69 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 70 | Software shall not be used to promote, endorse or advertise any 71 | Modified Version, except to acknowledge the contribution(s) of the 72 | Copyright Holder(s) and the Author(s) or with their explicit written 73 | permission. 74 | 75 | 5) The Font Software, modified or unmodified, in part or in whole, 76 | must be distributed entirely under this license, and must not be 77 | distributed under any other license. The requirement for fonts to 78 | remain under this license does not apply to any document created 79 | using the Font Software. 80 | 81 | TERMINATION 82 | This license becomes null and void if any of the above conditions are 83 | not met. 84 | 85 | DISCLAIMER 86 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 87 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 88 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 89 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 90 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 91 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 92 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 94 | OTHER DEALINGS IN THE FONT SOFTWARE. 95 | -------------------------------------------------------------------------------- /dodgethenim/assets/fonts/Xolonium-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/fonts/Xolonium-Regular.ttf -------------------------------------------------------------------------------- /dodgethenim/assets/sounds/House In a Forest Loop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sounds/House In a Forest Loop.ogg -------------------------------------------------------------------------------- /dodgethenim/assets/sounds/House In a Forest Loop.ogg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="ogg_vorbis" 4 | type="AudioStreamOGGVorbis" 5 | path="res://.import/House In a Forest Loop.ogg-8e554a1330e4ae364eda6047fe717533.oggstr" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sounds/House In a Forest Loop.ogg" 10 | source_md5="c395b0cc351a71713417cf862282849f" 11 | 12 | dest_files=[ "res://.import/House In a Forest Loop.ogg-8e554a1330e4ae364eda6047fe717533.oggstr" ] 13 | dest_md5="d5f326dad4704ccac37f4ea389ed5b91" 14 | 15 | [params] 16 | 17 | loop=true 18 | loop_offset=0 19 | -------------------------------------------------------------------------------- /dodgethenim/assets/sounds/gameover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sounds/gameover.wav -------------------------------------------------------------------------------- /dodgethenim/assets/sounds/gameover.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/gameover.wav-944a3aa74701aafe6d87d1a40186f241.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sounds/gameover.wav" 10 | source_md5="fe94a3a7558cff917a5500a1298fdcac" 11 | 12 | dest_files=[ "res://.import/gameover.wav-944a3aa74701aafe6d87d1a40186f241.sample" ] 13 | dest_md5="c62f0d7d03355e3fdbac32a3874201d1" 14 | 15 | [params] 16 | 17 | force/8_bit=false 18 | force/mono=false 19 | force/max_rate=false 20 | force/max_rate_hz=44100 21 | edit/trim=true 22 | edit/normalize=true 23 | edit/loop=false 24 | compress/mode=0 25 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyFlyingAlt_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemyFlyingAlt_1.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyFlyingAlt_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyFlyingAlt_1.png-e55523ede5c0e21ae63f4c282a8c2ca9.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemyFlyingAlt_1.png" 10 | source_md5="64d9fdc23f76112a64a283673e3fd8dd" 11 | 12 | dest_files=[ "res://.import/enemyFlyingAlt_1.png-e55523ede5c0e21ae63f4c282a8c2ca9.stex" ] 13 | dest_md5="0195b3b100c7fb890998883bce89a0cf" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyFlyingAlt_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemyFlyingAlt_2.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyFlyingAlt_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyFlyingAlt_2.png-345c3e2dabbc0dee2d7136eb2bbb52cf.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemyFlyingAlt_2.png" 10 | source_md5="5281b0d2b947deb09cbf95ecf9628ae7" 11 | 12 | dest_files=[ "res://.import/enemyFlyingAlt_2.png-345c3e2dabbc0dee2d7136eb2bbb52cf.stex" ] 13 | dest_md5="aefe97d74cf21f686f6fca9f4b5d00f3" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemySwimming_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemySwimming_1.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemySwimming_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemySwimming_1.png-d188d6b80689d4f1cea218dec2a3ef25.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemySwimming_1.png" 10 | source_md5="5e557d1bd564dd553650de1c38746ed9" 11 | 12 | dest_files=[ "res://.import/enemySwimming_1.png-d188d6b80689d4f1cea218dec2a3ef25.stex" ] 13 | dest_md5="e783d7053d9135598380e419d9aa492b" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemySwimming_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemySwimming_2.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemySwimming_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemySwimming_2.png-8047fa43fe1eb727391543daa838e153.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemySwimming_2.png" 10 | source_md5="d04b001ba2f4ac6884fdbe44b55fa656" 11 | 12 | dest_files=[ "res://.import/enemySwimming_2.png-8047fa43fe1eb727391543daa838e153.stex" ] 13 | dest_md5="bdc75ce5c86a6b1a590ba62149d2422a" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyWalking_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemyWalking_1.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyWalking_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyWalking_1.png-a388e49ab47a01f8e8fcecc60461315e.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemyWalking_1.png" 10 | source_md5="0e417b74e72f5d8f4aca0e557a735643" 11 | 12 | dest_files=[ "res://.import/enemyWalking_1.png-a388e49ab47a01f8e8fcecc60461315e.stex" ] 13 | dest_md5="8d24755a9f76b98ea8383a02a15b2431" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyWalking_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/enemyWalking_2.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/enemyWalking_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/enemyWalking_2.png-129eaca5d1fcaba01b5f5baac65e5955.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/enemyWalking_2.png" 10 | source_md5="838f40a8b77a0cb387dc5e5aff6bd8d5" 11 | 12 | dest_files=[ "res://.import/enemyWalking_2.png-129eaca5d1fcaba01b5f5baac65e5955.stex" ] 13 | dest_md5="f3c83e556d129fb193aa0f833d3f1cae" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/playerGrey_up1.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_up1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_up1.png-aa8895b35bd9e91bc5c98c569f9960c9.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/playerGrey_up1.png" 10 | source_md5="f84241d41055080a3393c9a8619f172b" 11 | 12 | dest_files=[ "res://.import/playerGrey_up1.png-aa8895b35bd9e91bc5c98c569f9960c9.stex" ] 13 | dest_md5="572e9245901387b8d67cbbde5205f058" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/playerGrey_up2.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_up2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_up2.png-03d4525fdaa671ce2c20dc82ceff4df1.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/playerGrey_up2.png" 10 | source_md5="57618c302a312d248705c7f045978765" 11 | 12 | dest_files=[ "res://.import/playerGrey_up2.png-03d4525fdaa671ce2c20dc82ceff4df1.stex" ] 13 | dest_md5="7d92827f17afa3633a9e2e4299de2015" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/playerGrey_walk1.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_walk1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_walk1.png-6e3683505061efbcedb14de666c244a8.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/playerGrey_walk1.png" 10 | source_md5="7892ed98ba910fbda0d37266127e96bb" 11 | 12 | dest_files=[ "res://.import/playerGrey_walk1.png-6e3683505061efbcedb14de666c244a8.stex" ] 13 | dest_md5="d46a147ac5231d0c720e27684d5df250" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/assets/sprites/playerGrey_walk2.png -------------------------------------------------------------------------------- /dodgethenim/assets/sprites/playerGrey_walk2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/playerGrey_walk2.png-ebc8a4a8e78075d773235e5ccdb763a6.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://assets/sprites/playerGrey_walk2.png" 10 | source_md5="9fc73e1224a6b16d8fb5d0f667e3aed2" 11 | 12 | dest_files=[ "res://.import/playerGrey_walk2.png-ebc8a4a8e78075d773235e5ccdb763a6.stex" ] 13 | dest_md5="596beded1de352875570362ee213a3e1" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | radiance_size = 4 6 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 7 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 8 | sky_curve = 0.25 9 | sky_energy = 1.0 10 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 11 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 12 | ground_curve = 0.01 13 | ground_energy = 1.0 14 | sun_color = Color( 1, 1, 1, 1 ) 15 | sun_latitude = 35.0 16 | sun_longitude = 0.0 17 | sun_angle_min = 1.0 18 | sun_angle_max = 100.0 19 | sun_curve = 0.05 20 | sun_energy = 16.0 21 | texture_size = 2 22 | 23 | [resource] 24 | 25 | background_mode = 2 26 | background_sky = SubResource( 1 ) 27 | background_sky_custom_fov = 0.0 28 | background_color = Color( 0, 0, 0, 1 ) 29 | background_energy = 1.0 30 | background_canvas_max_layer = 0 31 | ambient_light_color = Color( 0, 0, 0, 1 ) 32 | ambient_light_energy = 1.0 33 | ambient_light_sky_contribution = 0.0 34 | fog_enabled = false 35 | fog_color = Color( 0.5, 0.6, 0.7, 1 ) 36 | fog_sun_color = Color( 1, 0.9, 0.7, 1 ) 37 | fog_sun_amount = 0.0 38 | fog_depth_enabled = true 39 | fog_depth_begin = 10.0 40 | fog_depth_curve = 1.0 41 | fog_transmit_enabled = false 42 | fog_transmit_curve = 1.0 43 | fog_height_enabled = false 44 | fog_height_min = 0.0 45 | fog_height_max = 100.0 46 | fog_height_curve = 1.0 47 | tonemap_mode = 0 48 | tonemap_exposure = 1.0 49 | tonemap_white = 1.0 50 | auto_exposure_enabled = false 51 | auto_exposure_scale = 0.4 52 | auto_exposure_min_luma = 0.05 53 | auto_exposure_max_luma = 8.0 54 | auto_exposure_speed = 0.5 55 | ss_reflections_enabled = false 56 | ss_reflections_max_steps = 64 57 | ss_reflections_fade_in = 0.15 58 | ss_reflections_fade_out = 2.0 59 | ss_reflections_depth_tolerance = 0.2 60 | ss_reflections_roughness = true 61 | ssao_enabled = false 62 | ssao_radius = 1.0 63 | ssao_intensity = 1.0 64 | ssao_radius2 = 0.0 65 | ssao_intensity2 = 1.0 66 | ssao_bias = 0.01 67 | ssao_light_affect = 0.0 68 | ssao_color = Color( 0, 0, 0, 1 ) 69 | ssao_quality = 0 70 | ssao_blur = 1 71 | ssao_edge_sharpness = 4.0 72 | dof_blur_far_enabled = false 73 | dof_blur_far_distance = 10.0 74 | dof_blur_far_transition = 5.0 75 | dof_blur_far_amount = 0.1 76 | dof_blur_far_quality = 1 77 | dof_blur_near_enabled = false 78 | dof_blur_near_distance = 2.0 79 | dof_blur_near_transition = 1.0 80 | dof_blur_near_amount = 0.1 81 | dof_blur_near_quality = 1 82 | glow_enabled = false 83 | glow_levels/1 = false 84 | glow_levels/2 = false 85 | glow_levels/3 = true 86 | glow_levels/4 = false 87 | glow_levels/5 = true 88 | glow_levels/6 = false 89 | glow_levels/7 = false 90 | glow_intensity = 0.8 91 | glow_strength = 1.0 92 | glow_bloom = 0.0 93 | glow_blend_mode = 2 94 | glow_hdr_threshold = 1.0 95 | glow_hdr_scale = 2.0 96 | glow_bicubic_upscale = false 97 | adjustment_enabled = false 98 | adjustment_brightness = 1.0 99 | adjustment_contrast = 1.0 100 | adjustment_saturation = 1.0 101 | 102 | -------------------------------------------------------------------------------- /dodgethenim/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/dodgethenim/icon.png -------------------------------------------------------------------------------- /dodgethenim/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | source_md5="c3558f79862e8e00c74fb188280dd8ef" 11 | 12 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 13 | dest_md5="faf846ccd89e2edfcabb6f1c3125aa7e" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /dodgethenim/nakefile.nim: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Xored Software, Inc. 2 | 3 | import nake 4 | import os, ospaths, times 5 | import godotapigen 6 | 7 | proc genGodotApi() = 8 | let godotBin = getEnv("GODOT_BIN") 9 | if godotBin.len == 0: 10 | echo "GODOT_BIN environment variable is not set" 11 | quit(-1) 12 | if not fileExists(godotBin): 13 | echo "Invalid GODOT_BIN path: " & godotBin 14 | quit(-1) 15 | 16 | const targetDir = "src"/"godotapi" 17 | createDir(targetDir) 18 | const jsonFile = targetDir/"api.json" 19 | if not fileExists(jsonFile) or 20 | godotBin.getLastModificationTime() > jsonFile.getLastModificationTime(): 21 | direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile) 22 | if not fileExists(jsonFile): 23 | echo "Failed to generate api.json" 24 | quit(-1) 25 | 26 | genApi(targetDir, jsonFile) 27 | 28 | task "build", "Builds the client for the current platform": 29 | genGodotApi() 30 | let bitsPostfix = when sizeof(int) == 8: "_64" else: "_32" 31 | let libFile = 32 | when defined(windows): 33 | "nim" & bitsPostfix & ".dll" 34 | elif defined(ios): 35 | "nim_ios" & bitsPostfix & ".dylib" 36 | elif defined(macosx): 37 | "nim_mac.dylib" 38 | elif defined(android): 39 | "libnim_android.so" 40 | elif defined(linux): 41 | "nim_linux" & bitsPostfix & ".so" 42 | else: nil 43 | createDir("_dlls") 44 | withDir "src": 45 | direShell(["nimble", "c", ".."/"src"/"stub.nim", "--oldgensym:on", "-o:.."/"_dlls"/libFile]) 46 | 47 | task "clean", "Remove files produced by build": 48 | removeDir(".nimcache") 49 | removeDir("src"/".nimcache") 50 | removeDir("src"/"godotapi") 51 | removeDir("_dlls") 52 | removeFile("nakefile") 53 | removeFile("nakefile.exe") 54 | -------------------------------------------------------------------------------- /dodgethenim/nakefile.nim.cfg: -------------------------------------------------------------------------------- 1 | nimcache=".nimcache" -------------------------------------------------------------------------------- /dodgethenim/nimlib.gdnlib: -------------------------------------------------------------------------------- 1 | [entry] 2 | 3 | X11.64="res://_dlls/nim_linux_64.so" 4 | X11.32="res://_dlls/nim_linux_32.so" 5 | Windows.64="res://_dlls/nim_64.dll" 6 | Windows.32="res://_dlls/nim_32.dll" 7 | OSX.64="res://_dlls/nim_mac.dylib" 8 | Android.armeabi-v7a="res://_dlls/armeabi-v7a/libnim_android.so" 9 | iOS.armv7="res://_dlls/nim_ios_32.a" 10 | iOS.arm64="res://_dlls/nim_ios_64.a" 11 | 12 | [general] 13 | 14 | singleton=false 15 | load_once=true 16 | symbol_prefix="godot_" 17 | 18 | [dependencies] 19 | 20 | Windows=PoolStringArray() -------------------------------------------------------------------------------- /dodgethenim/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=3 10 | 11 | [application] 12 | 13 | config/name="Dodge the Nims!" 14 | run/main_scene="res://scenes/Main.tscn" 15 | config/icon="res://icon.png" 16 | 17 | [display] 18 | 19 | window/size/width=480 20 | window/size/height=720 21 | window/handheld/orientation="portrait" 22 | 23 | [gdnative] 24 | 25 | singletons=[ ] 26 | 27 | [rendering] 28 | 29 | environment/default_environment="res://default_env.tres" 30 | -------------------------------------------------------------------------------- /dodgethenim/scenes/Hud.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://scripts/Hud.gdns" type="Script" id=1] 4 | [ext_resource path="res://assets/fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2] 5 | 6 | [sub_resource type="DynamicFont" id=1] 7 | 8 | size = 64 9 | use_mipmaps = false 10 | use_filter = false 11 | font_data = ExtResource( 2 ) 12 | _sections_unfolded = [ "Resource", "Settings" ] 13 | 14 | [sub_resource type="DynamicFont" id=2] 15 | 16 | size = 64 17 | use_mipmaps = false 18 | use_filter = false 19 | font_data = ExtResource( 2 ) 20 | _sections_unfolded = [ "Font", "Resource", "Settings" ] 21 | 22 | [sub_resource type="DynamicFont" id=3] 23 | 24 | size = 48 25 | use_mipmaps = false 26 | use_filter = false 27 | font_data = ExtResource( 2 ) 28 | _sections_unfolded = [ "Font", "Settings" ] 29 | 30 | [node name="Hud" type="CanvasLayer"] 31 | 32 | layer = 1 33 | offset = Vector2( 0, 0 ) 34 | rotation = 0.0 35 | scale = Vector2( 1, 1 ) 36 | transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 37 | script = ExtResource( 1 ) 38 | 39 | [node name="ScoreLabel" type="Label" parent="." index="0"] 40 | 41 | anchor_left = 0.5 42 | anchor_top = 0.0 43 | anchor_right = 0.5 44 | anchor_bottom = 0.0 45 | margin_left = -25.0 46 | margin_top = 13.0 47 | margin_right = 25.0 48 | margin_bottom = 113.0 49 | rect_pivot_offset = Vector2( 0, 0 ) 50 | rect_clip_content = false 51 | mouse_filter = 2 52 | mouse_default_cursor_shape = 0 53 | size_flags_horizontal = 1 54 | size_flags_vertical = 4 55 | custom_fonts/font = SubResource( 1 ) 56 | text = "0" 57 | percent_visible = 1.0 58 | lines_skipped = 0 59 | max_lines_visible = -1 60 | _sections_unfolded = [ "custom_fonts" ] 61 | 62 | [node name="StartButton" type="Button" parent="." index="1"] 63 | 64 | anchor_left = 0.5 65 | anchor_top = 0.5 66 | anchor_right = 0.5 67 | anchor_bottom = 0.5 68 | margin_left = -99.5 69 | margin_top = -42.0 70 | margin_right = 99.5 71 | margin_bottom = 42.0 72 | rect_pivot_offset = Vector2( 0, 0 ) 73 | rect_clip_content = false 74 | focus_mode = 2 75 | mouse_filter = 0 76 | mouse_default_cursor_shape = 0 77 | size_flags_horizontal = 1 78 | size_flags_vertical = 1 79 | custom_fonts/font = SubResource( 2 ) 80 | toggle_mode = false 81 | enabled_focus_mode = 2 82 | shortcut = null 83 | group = null 84 | text = "Start!" 85 | flat = false 86 | align = 1 87 | _sections_unfolded = [ "custom_fonts" ] 88 | 89 | [node name="MessageLabel" type="Label" parent="." index="2"] 90 | 91 | anchor_left = 0.5 92 | anchor_top = 1.0 93 | anchor_right = 0.5 94 | anchor_bottom = 1.0 95 | margin_left = -230.0 96 | margin_top = -70.0 97 | margin_right = 388.0 98 | margin_bottom = 20.0 99 | rect_pivot_offset = Vector2( 0, 0 ) 100 | rect_clip_content = false 101 | mouse_filter = 2 102 | mouse_default_cursor_shape = 0 103 | size_flags_horizontal = 1 104 | size_flags_vertical = 4 105 | custom_fonts/font = SubResource( 3 ) 106 | text = "Dodge the Creeps!" 107 | percent_visible = 1.0 108 | lines_skipped = 0 109 | max_lines_visible = -1 110 | _sections_unfolded = [ "Margin", "custom_fonts" ] 111 | 112 | [node name="MessageTimer" type="Timer" parent="." index="3"] 113 | 114 | process_mode = 1 115 | wait_time = 1.0 116 | one_shot = false 117 | autostart = false 118 | 119 | 120 | -------------------------------------------------------------------------------- /dodgethenim/scenes/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://scripts/Main.gdns" type="Script" id=1] 4 | [ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://scenes/Hud.tscn" type="PackedScene" id=3] 6 | 7 | [sub_resource type="Curve2D" id=1] 8 | 9 | bake_interval = 5.0 10 | _data = { 11 | "points": PoolVector2Array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0 ) 12 | } 13 | 14 | [node name="Main" type="Node" index="0"] 15 | 16 | script = ExtResource( 1 ) 17 | _sections_unfolded = [ "Pause" ] 18 | 19 | [node name="ColorRect" type="ColorRect" parent="." index="0"] 20 | 21 | anchor_left = 0.0 22 | anchor_top = 0.0 23 | anchor_right = 0.0 24 | anchor_bottom = 0.0 25 | margin_right = 477.0 26 | margin_bottom = 716.0 27 | rect_pivot_offset = Vector2( 0, 0 ) 28 | rect_clip_content = false 29 | mouse_filter = 0 30 | mouse_default_cursor_shape = 0 31 | size_flags_horizontal = 1 32 | size_flags_vertical = 1 33 | color = Color( 0.0153809, 0.511208, 0.5625, 1 ) 34 | 35 | [node name="Player" parent="." index="1" instance=ExtResource( 2 )] 36 | 37 | [node name="MobTimer" type="Timer" parent="." index="2"] 38 | 39 | process_mode = 1 40 | wait_time = 0.5 41 | one_shot = false 42 | autostart = false 43 | 44 | [node name="ScoreTimer" type="Timer" parent="." index="3"] 45 | 46 | process_mode = 1 47 | wait_time = 1.0 48 | one_shot = false 49 | autostart = false 50 | 51 | [node name="StartTimer" type="Timer" parent="." index="4"] 52 | 53 | process_mode = 1 54 | wait_time = 2.0 55 | one_shot = true 56 | autostart = false 57 | 58 | [node name="StartPosition" type="Position2D" parent="." index="5"] 59 | 60 | position = Vector2( 240, 450 ) 61 | _sections_unfolded = [ "Transform" ] 62 | 63 | [node name="MobPath" type="Path2D" parent="." index="6"] 64 | 65 | editor/display_folded = true 66 | curve = SubResource( 1 ) 67 | 68 | [node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath" index="0"] 69 | 70 | offset = 0.0 71 | h_offset = 0.0 72 | v_offset = 0.0 73 | rotate = true 74 | cubic_interp = true 75 | loop = true 76 | lookahead = 4.0 77 | 78 | [node name="Hud" parent="." index="7" instance=ExtResource( 3 )] 79 | 80 | 81 | -------------------------------------------------------------------------------- /dodgethenim/scenes/Mob.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=2] 2 | 3 | [ext_resource path="res://scripts/Mob.gdns" type="Script" id=1] 4 | [ext_resource path="res://assets/sprites/enemySwimming_1.png" type="Texture" id=2] 5 | [ext_resource path="res://assets/sprites/enemySwimming_2.png" type="Texture" id=3] 6 | [ext_resource path="res://assets/sprites/enemyFlyingAlt_1.png" type="Texture" id=4] 7 | [ext_resource path="res://assets/sprites/enemyFlyingAlt_2.png" type="Texture" id=5] 8 | [ext_resource path="res://assets/sprites/enemyWalking_1.png" type="Texture" id=6] 9 | [ext_resource path="res://assets/sprites/enemyWalking_2.png" type="Texture" id=7] 10 | 11 | [sub_resource type="SpriteFrames" id=1] 12 | 13 | animations = [ { 14 | "frames": [ ExtResource( 2 ), ExtResource( 3 ) ], 15 | "loop": true, 16 | "name": "swim", 17 | "speed": 4.0 18 | }, { 19 | "frames": [ ExtResource( 4 ), ExtResource( 5 ) ], 20 | "loop": true, 21 | "name": "fly", 22 | "speed": 3.0 23 | }, { 24 | "frames": [ ExtResource( 6 ), ExtResource( 7 ) ], 25 | "loop": true, 26 | "name": "walk", 27 | "speed": 4.0 28 | } ] 29 | 30 | [sub_resource type="CapsuleShape2D" id=2] 31 | 32 | custom_solver_bias = 0.0 33 | radius = 10.0 34 | height = 20.0 35 | 36 | [node name="Mob" type="RigidBody2D"] 37 | 38 | input_pickable = false 39 | collision_layer = 1 40 | collision_mask = 0 41 | mode = 0 42 | mass = 1.0 43 | friction = 1.0 44 | bounce = 0.0 45 | gravity_scale = 0.0 46 | custom_integrator = false 47 | continuous_cd = 0 48 | contacts_reported = 0 49 | contact_monitor = false 50 | sleeping = false 51 | can_sleep = true 52 | linear_velocity = Vector2( 0, 0 ) 53 | linear_damp = -1.0 54 | angular_velocity = 0.0 55 | angular_damp = -1.0 56 | script = ExtResource( 1 ) 57 | _sections_unfolded = [ "Collision" ] 58 | min_speed = 150 59 | max_speed = 250 60 | 61 | [node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"] 62 | 63 | frames = SubResource( 1 ) 64 | animation = "fly" 65 | playing = true 66 | _sections_unfolded = [ "Visibility" ] 67 | 68 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"] 69 | 70 | position = Vector2( -4.6905, 1.06048 ) 71 | rotation = 1.5708 72 | scale = Vector2( 4.63827, 3.08089 ) 73 | shape = SubResource( 2 ) 74 | _sections_unfolded = [ "Transform" ] 75 | 76 | [node name="Visibility" type="VisibilityNotifier2D" parent="." index="2"] 77 | 78 | rect = Rect2( -10, -10, 20, 20 ) 79 | 80 | 81 | -------------------------------------------------------------------------------- /dodgethenim/scenes/Player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://scripts/Player.gdns" type="Script" id=1] 4 | [ext_resource path="res://assets/sprites/playerGrey_walk1.png" type="Texture" id=2] 5 | [ext_resource path="res://assets/sprites/playerGrey_walk2.png" type="Texture" id=3] 6 | [ext_resource path="res://assets/sprites/playerGrey_up1.png" type="Texture" id=4] 7 | [ext_resource path="res://assets/sprites/playerGrey_up2.png" type="Texture" id=5] 8 | 9 | [sub_resource type="SpriteFrames" id=1] 10 | 11 | animations = [ { 12 | "frames": [ ExtResource( 2 ), ExtResource( 3 ) ], 13 | "loop": true, 14 | "name": "right", 15 | "speed": 5.0 16 | }, { 17 | "frames": [ ExtResource( 4 ), ExtResource( 5 ) ], 18 | "loop": true, 19 | "name": "up", 20 | "speed": 5.0 21 | } ] 22 | 23 | [sub_resource type="CapsuleShape2D" id=2] 24 | 25 | custom_solver_bias = 0.0 26 | radius = 10.1705 27 | height = 20.0 28 | 29 | [node name="Player" type="Area2D" index="0"] 30 | 31 | position = Vector2( 245.461, 223.614 ) 32 | input_pickable = true 33 | gravity_vec = Vector2( 0, 1 ) 34 | gravity = 98.0 35 | linear_damp = 0.1 36 | angular_damp = 1.0 37 | audio_bus_override = false 38 | audio_bus_name = "Master" 39 | script = ExtResource( 1 ) 40 | _sections_unfolded = [ "Pickable", "Transform" ] 41 | __meta__ = { 42 | "_edit_group_": true 43 | } 44 | speed = 400 45 | 46 | [node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"] 47 | 48 | scale = Vector2( 0.5, 0.5 ) 49 | frames = SubResource( 1 ) 50 | animation = "up" 51 | _sections_unfolded = [ "Transform", "Visibility" ] 52 | 53 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"] 54 | 55 | position = Vector2( -0.0651894, 0.55131 ) 56 | scale = Vector2( 2.68333, 1.69596 ) 57 | shape = SubResource( 2 ) 58 | __meta__ = { 59 | "_edit_group_": true 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /dodgethenim/scripts/Hud.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | resource_name = "Hud" 8 | class_name = "Hud" 9 | library = ExtResource( 1 ) 10 | 11 | -------------------------------------------------------------------------------- /dodgethenim/scripts/Main.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | resource_name = "Main" 8 | class_name = "Main" 9 | library = ExtResource( 1 ) 10 | 11 | -------------------------------------------------------------------------------- /dodgethenim/scripts/Mob.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | resource_name = "Mob" 8 | class_name = "Mob" 9 | library = ExtResource( 1 ) 10 | 11 | -------------------------------------------------------------------------------- /dodgethenim/scripts/Player.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | resource_name = "Player" 8 | class_name = "Player" 9 | library = ExtResource( 1 ) 10 | 11 | -------------------------------------------------------------------------------- /dodgethenim/src/config.nims: -------------------------------------------------------------------------------- 1 | import ospaths 2 | 3 | switch("nimcache", ".nimcache"/hostOS/hostCPU) 4 | 5 | when defined(macosx): 6 | when defined(ios): 7 | if hostCPU == "arm64": 8 | switch("passC", "-arch arm64") 9 | switch("passL", "-arch arm64") 10 | elif hostCPU == "arm": 11 | switch("passC", "-arch armv7") 12 | switch("passL", "-arch armv7") 13 | switch("passC", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 14 | switch("passL", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 15 | else: 16 | switch("passL", "-framework Cocoa") 17 | elif defined(android): 18 | let ndk = getEnv("ANDROID_NDK_ROOT") 19 | let toolchain = getEnv("ANDROID_TOOLCHAIN") 20 | 21 | if ndk.len == 0: 22 | raise newException(OSError, 23 | "ANDROID_NDK_ROOT environment variable is necessary for android build") 24 | if toolchain.len == 0: 25 | raise newException(OSError, 26 | "ANDROID_TOOLCHAIN environment variable is necessary for android build") 27 | 28 | const level = $16 # change this to the necessary API level 29 | const arch = "arm" 30 | let sysroot = "--sysroot=\"" & ndk & "/platforms/android-" & level & "/arch-" & arch & "/\"" 31 | switch("passL", sysroot) 32 | switch("passC", sysroot) 33 | 34 | switch("cc", "clang") 35 | switch("arm.linux.clang.path", toolchain / "bin") 36 | switch("arm.linux.clang.exe", arch & "-linux-androideabi-clang") 37 | switch("arm.linux.clang.compilerexe", arch & "-linux-androideabi-clang") 38 | switch("arm.linux.clang.linkerexe", arch & "-linux-androideabi-clang") 39 | elif defined(windows): 40 | assert(sizeof(int) == 8) 41 | switch("cc", "vcc") 42 | elif defined(linux): 43 | switch("passC", "-fPIC") 44 | else: 45 | raise newException(OSError, "Unsupported platform: " & hostOS) 46 | 47 | when not defined(release): 48 | switch("debugger", "native") 49 | -------------------------------------------------------------------------------- /dodgethenim/src/hud.nim: -------------------------------------------------------------------------------- 1 | import godot 2 | import godotapi/[canvas_layer, timer, label] 3 | import asyncdispatch 4 | 5 | gdobj Hud of CanvasLayer: 6 | var messageTimer: Timer 7 | var messageLabel: Label 8 | var startButton: Button 9 | var scoreLabel: Label 10 | 11 | proc init() = 12 | self.addUserSignal("start_game") 13 | 14 | proc showMessage*(text: string) = 15 | self.messageLabel.text = text 16 | self.messageLabel.show() 17 | self.messageTimer.start() 18 | 19 | proc showGameOver*() = 20 | self.showMessage("Game Over") 21 | discard sleepAsync(self.messageTimer.waitTime.int * 1000) 22 | self.messageLabel.text = "Game Over!" 23 | self.messageLabel.show() 24 | self.startButton.show() 25 | 26 | proc updateScore*(score: int) = 27 | self.scoreLabel.text = $score 28 | 29 | proc onStartButtonPressed*() {.gdExport.} = 30 | self.startButton.hide() 31 | self.emitSignal("start_game") 32 | 33 | proc onMessageTimerTimeout*() {.gdExport.} = 34 | self.messageLabel.hide() 35 | 36 | method ready*() = 37 | self.messageTimer = self.getNode("MessageTimer").as(Timer) 38 | self.messageLabel = self.getNode("MessageLabel").as(Label) 39 | self.startButton = self.getNode("StartButton").as(Button) 40 | self.scoreLabel = self.getNode("ScoreLabel").as(Label) 41 | discard self.messageTimer.connect("timeout", self, "on_message_timer_timeout", newArray()) 42 | discard self.startButton.connect("pressed", self, "on_start_button_pressed", newArray()) 43 | 44 | -------------------------------------------------------------------------------- /dodgethenim/src/main.nim: -------------------------------------------------------------------------------- 1 | import random, math 2 | import godot 3 | import godotapi/[packed_scene, area_2d, timer, path_follow_2d, rigid_body_2d, resource_loader] 4 | import player, mob, hud 5 | 6 | gdobj Main of Node: 7 | var score: int 8 | var mob* {.gdExport.}: PackedScene 9 | var player: Player 10 | var mobTimer: Timer 11 | var scoreTimer: Timer 12 | var startTimer: Timer 13 | var startPosition: Position2D 14 | var mobSpawnLocation: PathFollow2D 15 | var hud: Hud 16 | 17 | proc onStartTimerTimeout*() {.gdExport.} = 18 | self.mobTimer.start() 19 | self.scoreTimer.start() 20 | 21 | proc onScoreTimerTimeout*() {.gdExport.} = 22 | self.score += 1 23 | self.hud.updateScore(self.score) 24 | 25 | proc onMobTimerTimeout*() {.gdExport.} = 26 | #choose a random location on path2d 27 | self.mobSpawnLocation.offset = rand(high(int32)).float64 #ugly ass hack 28 | 29 | var direction = self.mobSpawnLocation.rotation + PI/2 30 | direction += rand(PI/2) 31 | 32 | #add the mob instance to our scene 33 | var mobInstance = self.mob.instance().as(RigidBody2D) 34 | mobInstance.position = self.mobSpawnLocation.position 35 | mobInstance.rotation = direction 36 | mobInstance.linearVelocity = vec2(rand(150.float..250.float), 0).rotated(direction) 37 | self.addChild(mobInstance) 38 | 39 | proc gameOver*() {.gdExport.} = 40 | self.scoreTimer.stop() 41 | self.mobTimer.stop() 42 | self.hud.showGameOver() 43 | 44 | proc newGame*() {.gdExport.} = 45 | self.score = 0 46 | self.hud.updateScore(self.score) 47 | self.hud.showMessage("Get Ready!") 48 | self.player.start(self.startPosition.position) 49 | self.startTimer.start() 50 | 51 | method ready*() = 52 | randomize() 53 | self.player = self.getNode("Player").as(Player) 54 | self.startTimer = self.getNode("StartTimer").as(Timer) 55 | self.scoreTimer = self.getNode("ScoreTimer").as(Timer) 56 | self.mobTimer = self.getNode("MobTimer").as(Timer) 57 | self.startPosition = self.getNode("StartPosition").as(Position2D) 58 | self.mobSpawnLocation = self.getNode("MobPath/MobSpawnLocation").as(PathFollow2D) 59 | self.hud = self.getNode("Hud").as(Hud) 60 | 61 | discard self.player.connect("hit", self, "game_over", newArray()) 62 | discard self.startTimer.connect("timeout", self, "on_start_timer_timeout", newArray()) 63 | discard self.scoreTimer.connect("timeout", self, "on_score_timer_timeout", newArray()) 64 | discard self.mobTimer.connect("timeout", self, "on_mob_timer_timeout", newArray()) 65 | discard self.hud.connect("start_game", self, "new_game", newArray()) -------------------------------------------------------------------------------- /dodgethenim/src/mob.nim: -------------------------------------------------------------------------------- 1 | import random 2 | import godot 3 | import godotapi/[rigid_body_2d, animated_sprite, visibility_notifier_2d] 4 | 5 | gdobj Mob of RigidBody2d: 6 | var minSpeed* {.gdExport.} = 150 7 | var maxSpeed* {.gdExport.} = 250 8 | var mobKinds: seq[string] = @["walk", "fly", "swim"] 9 | var animatedSprite: AnimatedSprite 10 | var visibility: VisibilityNotifier2D 11 | 12 | proc onVisibilityScreenExited*() {.gdExport.} = 13 | self.queueFree() 14 | 15 | method ready*() = 16 | self.visibility = self.getNode("Visibility").as(VisibilityNotifier2D) 17 | self.animatedSprite = self.getNode("AnimatedSprite").as(AnimatedSprite) 18 | self.animatedSprite.animation = sample(self.mobKinds) 19 | discard self.visibility.connect("screen_exited", self, "on_visibility_screen_exited", newArray()) 20 | 21 | -------------------------------------------------------------------------------- /dodgethenim/src/nim.cfg: -------------------------------------------------------------------------------- 1 | --path:"$projectdir" 2 | --path:"$projectdir/../_godotapi" 3 | --app:lib 4 | -d:useRealtimeGc 5 | --noMain 6 | --warning[LockLevel]:off -------------------------------------------------------------------------------- /dodgethenim/src/player.nim: -------------------------------------------------------------------------------- 1 | import godot 2 | import godotapi/[node_2d, area_2d, control, canvas_item, input, animated_sprite, 3 | scene_tree, collision_shape_2d, rigid_body_2d] 4 | 5 | gdobj Player of Area2D: 6 | var speed* {.gdExport.} = 400 7 | var screenSize: Vector2 8 | var collisionShape2D: CollisionShape2D 9 | var animatedSprite: AnimatedSprite 10 | var body: RigidBody2D 11 | 12 | method init*() = 13 | self.addUserSignal("hit") 14 | 15 | proc onPlayerBodyEntered*(body: Object) {.gdExport.} = 16 | self.hide() 17 | self.emitSignal("hit") 18 | self.collisionShape2D.disabled = true 19 | 20 | proc start*(pos: Vector2) = 21 | self.position = pos 22 | self.show() 23 | self.collisionShape2D.disabled = false 24 | 25 | method ready*() = 26 | self.screenSize = self.getViewPortRect().size 27 | self.collisionShape2D = self.getNode("CollisionShape2D").as(CollisionShape2D) 28 | self.animatedSprite = self.getNode("AnimatedSprite").as(AnimatedSprite) 29 | discard self.connect("body_entered", self, "on_player_body_entered", newArray()) 30 | self.hide() 31 | 32 | method process*(delta: float64) = 33 | var velocity = vec2() 34 | #handle movement 35 | if isActionPressed("ui_right"): velocity.x += 1 36 | if isActionPressed("ui_left"): velocity.x -= 1 37 | if isActionPressed("ui_down"): velocity.y += 1 38 | if isActionPressed("ui_up"): velocity.y -= 1 39 | 40 | #check if the player is moving so we can start/stop the animation 41 | if velocity.length() > 0: 42 | velocity = velocity.normalized() * self.speed.float64 43 | self.animatedSprite.play() 44 | else: 45 | self.animatedSprite.stop() 46 | #prevent player from leaving screen using clamp() 47 | self.position = (self.position + velocity * delta) 48 | self.position = vec2(clamp(self.position.x, 0, self.screenSize.x), 49 | clamp(self.position.y, 0, self.screenSize.y)) 50 | #handle left and down animation by flipping the sprite 51 | if velocity.x != 0: 52 | self.animatedSprite.animation = "right" 53 | self.animatedSprite.flipH = velocity.x < 0 54 | self.animatedSprite.flipV = false 55 | elif velocity.y != 0: 56 | self.animatedSprite.animation = "up" 57 | self.animatedSprite.flipV = velocity.y > 0 58 | 59 | 60 | -------------------------------------------------------------------------------- /dodgethenim/src/stub.nim: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Xored Software, Inc. 2 | 3 | ## Import independent scene objects here 4 | ## (no need to import everything, just independent roots) 5 | 6 | when not defined(release): 7 | import segfaults # converts segfaults into NilAccessError 8 | 9 | import player 10 | import mob 11 | import main 12 | import hud -------------------------------------------------------------------------------- /dodgethenim/src/stub.nimble: -------------------------------------------------------------------------------- 1 | version = "0.1.0" 2 | author = "Xored Software, Inc." 3 | description = "Godot-Nim Project Stub" 4 | license = "MIT" 5 | 6 | requires "godot >= 0.7.11 & < 0.8.0" -------------------------------------------------------------------------------- /nimway/.import/cell.png-81c2fb69d7e22398fca95d5a84080720.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/.import/cell.png-81c2fb69d7e22398fca95d5a84080720.stex -------------------------------------------------------------------------------- /nimway/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /nimway/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | radiance_size = 4 6 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 7 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 8 | sky_curve = 0.25 9 | sky_energy = 1.0 10 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 11 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 12 | ground_curve = 0.01 13 | ground_energy = 1.0 14 | sun_color = Color( 1, 1, 1, 1 ) 15 | sun_latitude = 35.0 16 | sun_longitude = 0.0 17 | sun_angle_min = 1.0 18 | sun_angle_max = 100.0 19 | sun_curve = 0.05 20 | sun_energy = 16.0 21 | texture_size = 2 22 | 23 | [resource] 24 | 25 | background_mode = 2 26 | background_sky = SubResource( 1 ) 27 | background_sky_custom_fov = 0.0 28 | background_color = Color( 0, 0, 0, 1 ) 29 | background_energy = 1.0 30 | background_canvas_max_layer = 0 31 | ambient_light_color = Color( 0, 0, 0, 1 ) 32 | ambient_light_energy = 1.0 33 | ambient_light_sky_contribution = 0.0 34 | fog_enabled = false 35 | fog_color = Color( 0.5, 0.6, 0.7, 1 ) 36 | fog_sun_color = Color( 1, 0.9, 0.7, 1 ) 37 | fog_sun_amount = 0.0 38 | fog_depth_enabled = true 39 | fog_depth_begin = 10.0 40 | fog_depth_curve = 1.0 41 | fog_transmit_enabled = false 42 | fog_transmit_curve = 1.0 43 | fog_height_enabled = false 44 | fog_height_min = 0.0 45 | fog_height_max = 100.0 46 | fog_height_curve = 1.0 47 | tonemap_mode = 0 48 | tonemap_exposure = 1.0 49 | tonemap_white = 1.0 50 | auto_exposure_enabled = false 51 | auto_exposure_scale = 0.4 52 | auto_exposure_min_luma = 0.05 53 | auto_exposure_max_luma = 8.0 54 | auto_exposure_speed = 0.5 55 | ss_reflections_enabled = false 56 | ss_reflections_max_steps = 64 57 | ss_reflections_fade_in = 0.15 58 | ss_reflections_fade_out = 2.0 59 | ss_reflections_depth_tolerance = 0.2 60 | ss_reflections_roughness = true 61 | ssao_enabled = false 62 | ssao_radius = 1.0 63 | ssao_intensity = 1.0 64 | ssao_radius2 = 0.0 65 | ssao_intensity2 = 1.0 66 | ssao_bias = 0.01 67 | ssao_light_affect = 0.0 68 | ssao_color = Color( 0, 0, 0, 1 ) 69 | ssao_quality = 0 70 | ssao_blur = 1 71 | ssao_edge_sharpness = 4.0 72 | dof_blur_far_enabled = false 73 | dof_blur_far_distance = 10.0 74 | dof_blur_far_transition = 5.0 75 | dof_blur_far_amount = 0.1 76 | dof_blur_far_quality = 1 77 | dof_blur_near_enabled = false 78 | dof_blur_near_distance = 2.0 79 | dof_blur_near_transition = 1.0 80 | dof_blur_near_amount = 0.1 81 | dof_blur_near_quality = 1 82 | glow_enabled = false 83 | glow_levels/1 = false 84 | glow_levels/2 = false 85 | glow_levels/3 = true 86 | glow_levels/4 = false 87 | glow_levels/5 = true 88 | glow_levels/6 = false 89 | glow_levels/7 = false 90 | glow_intensity = 0.8 91 | glow_strength = 1.0 92 | glow_bloom = 0.0 93 | glow_blend_mode = 2 94 | glow_hdr_threshold = 1.0 95 | glow_hdr_scale = 2.0 96 | glow_bicubic_upscale = false 97 | adjustment_enabled = false 98 | adjustment_brightness = 1.0 99 | adjustment_contrast = 1.0 100 | adjustment_saturation = 1.0 101 | 102 | -------------------------------------------------------------------------------- /nimway/fonts/Roboto/RobotoRegular.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFontData" format=2] 2 | 3 | [resource] 4 | 5 | font_path = "res://fonts/Roboto/ttf/Roboto-Regular.ttf" 6 | -------------------------------------------------------------------------------- /nimway/fonts/Roboto/ttf/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /nimway/fonts/Roboto/ttf/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/fonts/Roboto/ttf/Roboto-Regular.ttf -------------------------------------------------------------------------------- /nimway/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/icon.png -------------------------------------------------------------------------------- /nimway/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | source_md5="c3558f79862e8e00c74fb188280dd8ef" 11 | 12 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 13 | dest_md5="faf846ccd89e2edfcabb6f1c3125aa7e" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /nimway/nakefile.nim: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Xored Software, Inc. 2 | 3 | import nake 4 | import os, ospaths, times 5 | import godotapigen 6 | 7 | proc genGodotApi() = 8 | let godotBin = getEnv("GODOT_BIN") 9 | if godotBin.len == 0: 10 | echo "GODOT_BIN environment variable is not set" 11 | quit(-1) 12 | if not fileExists(godotBin): 13 | echo "Invalid GODOT_BIN path: " & godotBin 14 | quit(-1) 15 | 16 | const targetDir = "src"/"godotapi" 17 | createDir(targetDir) 18 | const jsonFile = targetDir/"api.json" 19 | if not fileExists(jsonFile) or 20 | godotBin.getLastModificationTime() > jsonFile.getLastModificationTime(): 21 | direShell(godotBin, "--gdnative-generate-json-api", getCurrentDir()/jsonFile) 22 | if not fileExists(jsonFile): 23 | echo "Failed to generate api.json" 24 | quit(-1) 25 | 26 | genApi(targetDir, jsonFile) 27 | 28 | task "build", "Builds the client for the current platform": 29 | genGodotApi() 30 | let bitsPostfix = when sizeof(int) == 8: "_64" else: "_32" 31 | let libFile = 32 | when defined(windows): 33 | "nim" & bitsPostfix & ".dll" 34 | elif defined(ios): 35 | "nim_ios" & bitsPostfix & ".dylib" 36 | elif defined(macosx): 37 | "nim_mac.dylib" 38 | elif defined(android): 39 | "libnim_android.so" 40 | elif defined(linux): 41 | "nim_linux" & bitsPostfix & ".so" 42 | else: nil 43 | createDir("_dlls") 44 | withDir "src": 45 | direShell(["nimble", "c", ".."/"src"/"stub.nim", "-o:.."/"_dlls"/libFile]) 46 | 47 | task "clean", "Remove files produced by build": 48 | removeDir(".nimcache") 49 | removeDir("src"/".nimcache") 50 | removeDir("src"/"godotapi") 51 | removeDir("_dlls") 52 | removeFile("nakefile") 53 | removeFile("nakefile.exe") 54 | -------------------------------------------------------------------------------- /nimway/nakefile.nim.cfg: -------------------------------------------------------------------------------- 1 | nimcache=".nimcache" -------------------------------------------------------------------------------- /nimway/nimlib.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | X11.64="res://_dlls/nim_linux_64.so" 11 | X11.32="res://_dlls/nim_linux_32.so" 12 | Windows.64="res://_dlls/nim_64.dll" 13 | Windows.32="res://_dlls/nim_32.dll" 14 | OSX.64="res://_dlls/nim_mac.dylib" 15 | Android.armeabi-v7a="res://_dlls/armeabi-v7a/libnim_android.so" 16 | iOS.armv7="res://_dlls/nim_ios_32.a" 17 | iOS.arm64="res://_dlls/nim_ios_64.a" 18 | 19 | [dependencies] 20 | 21 | Windows.64=[ ] 22 | -------------------------------------------------------------------------------- /nimway/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=3 10 | 11 | [application] 12 | 13 | config/name="Game of Life" 14 | run/main_scene="res://scenes/GameOfLife.tscn" 15 | config/icon="res://icon.png" 16 | 17 | [gdnative] 18 | 19 | singletons=[ ] 20 | 21 | [rendering] 22 | 23 | environment/default_environment="res://default_env.tres" 24 | -------------------------------------------------------------------------------- /nimway/scenes/Cell.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | [ext_resource path="res://sprites/cell.png" type="Texture" id=2] 5 | 6 | [sub_resource type="NativeScript" id=1] 7 | 8 | resource_name = "Cell" 9 | class_name = "Cell" 10 | library = ExtResource( 1 ) 11 | 12 | [sub_resource type="Animation" id=2] 13 | 14 | length = 1.0 15 | loop = false 16 | step = 0.1 17 | tracks/0/type = "value" 18 | tracks/0/path = NodePath("Sprite:modulate") 19 | tracks/0/interp = 1 20 | tracks/0/loop_wrap = true 21 | tracks/0/imported = false 22 | tracks/0/enabled = true 23 | tracks/0/keys = { 24 | "times": PoolRealArray( 0 ), 25 | "transitions": PoolRealArray( 1 ), 26 | "update": 0, 27 | "values": [ Color( 0.0352941, 0.0470588, 0.0470588, 1 ) ] 28 | } 29 | 30 | [sub_resource type="Animation" id=3] 31 | 32 | length = 1.0 33 | loop = false 34 | step = 0.1 35 | tracks/0/type = "value" 36 | tracks/0/path = NodePath("Sprite:modulate") 37 | tracks/0/interp = 1 38 | tracks/0/loop_wrap = true 39 | tracks/0/imported = false 40 | tracks/0/enabled = true 41 | tracks/0/keys = { 42 | "times": PoolRealArray( 0 ), 43 | "transitions": PoolRealArray( 1 ), 44 | "update": 0, 45 | "values": [ Color( 0.113998, 0.650521, 0.941406, 1 ) ] 46 | } 47 | 48 | [node name="Cell" type="Control"] 49 | 50 | anchor_left = 0.0 51 | anchor_top = 0.0 52 | anchor_right = 0.0 53 | anchor_bottom = 0.0 54 | margin_left = -16.0 55 | margin_top = -15.0 56 | margin_right = 16.0 57 | margin_bottom = 17.0 58 | rect_pivot_offset = Vector2( 0, 0 ) 59 | rect_clip_content = false 60 | mouse_filter = 0 61 | mouse_default_cursor_shape = 0 62 | size_flags_horizontal = 1 63 | size_flags_vertical = 1 64 | script = SubResource( 1 ) 65 | _sections_unfolded = [ "Margin" ] 66 | 67 | [node name="Sprite" type="Sprite" parent="." index="0"] 68 | 69 | modulate = Color( 0.0352941, 0.0470588, 0.0470588, 1 ) 70 | position = Vector2( -0.450745, 0.0985107 ) 71 | texture = ExtResource( 2 ) 72 | centered = false 73 | _sections_unfolded = [ "Visibility" ] 74 | 75 | [node name="AnimationPlayer" type="AnimationPlayer" parent="." index="1"] 76 | 77 | root_node = NodePath("..") 78 | autoplay = "" 79 | playback_process_mode = 1 80 | playback_default_blend_time = 0.0 81 | playback_speed = 1.0 82 | anims/Dead = SubResource( 2 ) 83 | anims/Living = SubResource( 3 ) 84 | blend_times = [ ] 85 | 86 | 87 | -------------------------------------------------------------------------------- /nimway/scenes/GameOfLife.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [sub_resource type="NativeScript" id=1] 6 | 7 | resource_name = "GoL" 8 | class_name = "GoL" 9 | library = ExtResource( 1 ) 10 | _sections_unfolded = [ "Resource" ] 11 | 12 | [node name="GameOfLife" type="Node2D" index="0"] 13 | 14 | position = Vector2( 36.5383, 37.2376 ) 15 | script = SubResource( 1 ) 16 | 17 | [node name="StepTimer" type="Timer" parent="." index="0"] 18 | 19 | process_mode = 1 20 | wait_time = 1.3 21 | one_shot = false 22 | autostart = true 23 | _sections_unfolded = [ "Pause" ] 24 | 25 | [node name="StartPosition" type="Position2D" parent="." index="1"] 26 | 27 | position = Vector2( 300, 100 ) 28 | _sections_unfolded = [ "Transform" ] 29 | 30 | [node name="ResetButton" type="Button" parent="." index="2"] 31 | 32 | anchor_left = 0.0 33 | anchor_top = 0.0 34 | anchor_right = 0.0 35 | anchor_bottom = 0.0 36 | margin_left = 418.0 37 | margin_top = -25.0 38 | margin_right = 536.0 39 | margin_bottom = 37.0 40 | rect_pivot_offset = Vector2( 0, 0 ) 41 | rect_clip_content = false 42 | focus_mode = 2 43 | mouse_filter = 0 44 | mouse_default_cursor_shape = 0 45 | size_flags_horizontal = 1 46 | size_flags_vertical = 1 47 | toggle_mode = false 48 | enabled_focus_mode = 2 49 | shortcut = null 50 | group = null 51 | text = "Reset" 52 | flat = false 53 | align = 1 54 | 55 | 56 | -------------------------------------------------------------------------------- /nimway/scripts/Cell.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | class_name = "Cell" 8 | library = ExtResource( 1 ) 9 | _sections_unfolded = [ "Resource" ] 10 | 11 | -------------------------------------------------------------------------------- /nimway/scripts/GoL.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://nimlib.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | resource_name = "GoL" 8 | class_name = "GoL" 9 | library = ExtResource( 1 ) 10 | _sections_unfolded = [ "Resource" ] 11 | 12 | -------------------------------------------------------------------------------- /nimway/sprites/9sii4k0j.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/sprites/9sii4k0j.bmp -------------------------------------------------------------------------------- /nimway/sprites/cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zetashift/godotnim-samples/4cd7701ceba97bc3d4574dd9a869b86a4b48269e/nimway/sprites/cell.png -------------------------------------------------------------------------------- /nimway/sprites/cell.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cell.png-81c2fb69d7e22398fca95d5a84080720.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://sprites/cell.png" 10 | source_md5="672160c37fd1aa6b27bf4ab5b9184aeb" 11 | 12 | dest_files=[ "res://.import/cell.png-81c2fb69d7e22398fca95d5a84080720.stex" ] 13 | dest_md5="2f6865c73c43f653c992f25c4442e13c" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /nimway/src/cell.nim: -------------------------------------------------------------------------------- 1 | import godot 2 | import godotapi / [animation_player, control] 3 | 4 | type 5 | CellKind* {.pure.} = enum 6 | Living 7 | Dead 8 | 9 | gdobj Cell of Control: 10 | var kind: CellKind 11 | var x*, y*: int 12 | var anim: AnimationPlayer 13 | 14 | method ready*() = 15 | self.anim = self.getNode("AnimationPlayer").as(AnimationPlayer) 16 | 17 | proc initTile*(x,y: int) = 18 | self.x = x 19 | self.y = y 20 | 21 | proc setKind*(kind: CellKind) = 22 | self.kind = kind 23 | case kind: 24 | of CellKind.Living: 25 | self.anim.play("Living") 26 | of CellKind.Dead: 27 | self.anim.play("Dead") 28 | 29 | proc getKind*(): CellKind = 30 | self.kind 31 | 32 | -------------------------------------------------------------------------------- /nimway/src/config.nims: -------------------------------------------------------------------------------- 1 | import ospaths 2 | 3 | switch("nimcache", ".nimcache"/hostOS/hostCPU) 4 | 5 | when defined(macosx): 6 | when defined(ios): 7 | if hostCPU == "arm64": 8 | switch("passC", "-arch arm64") 9 | switch("passL", "-arch arm64") 10 | elif hostCPU == "arm": 11 | switch("passC", "-arch armv7") 12 | switch("passL", "-arch armv7") 13 | switch("passC", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 14 | switch("passL", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk") 15 | else: 16 | switch("passL", "-framework Cocoa") 17 | elif defined(android): 18 | let ndk = getEnv("ANDROID_NDK_ROOT") 19 | let toolchain = getEnv("ANDROID_TOOLCHAIN") 20 | 21 | if ndk.len == 0: 22 | raise newException(OSError, 23 | "ANDROID_NDK_ROOT environment variable is necessary for android build") 24 | if toolchain.len == 0: 25 | raise newException(OSError, 26 | "ANDROID_TOOLCHAIN environment variable is necessary for android build") 27 | 28 | const level = $16 # change this to the necessary API level 29 | const arch = "arm" 30 | let sysroot = "--sysroot=\"" & ndk & "/platforms/android-" & level & "/arch-" & arch & "/\"" 31 | switch("passL", sysroot) 32 | switch("passC", sysroot) 33 | 34 | switch("cc", "clang") 35 | switch("arm.linux.clang.path", toolchain / "bin") 36 | switch("arm.linux.clang.exe", arch & "-linux-androideabi-clang") 37 | switch("arm.linux.clang.compilerexe", arch & "-linux-androideabi-clang") 38 | switch("arm.linux.clang.linkerexe", arch & "-linux-androideabi-clang") 39 | elif defined(windows): 40 | assert(sizeof(int) == 8) 41 | switch("cc", "vcc") 42 | elif defined(linux): 43 | switch("passC", "-fPIC") 44 | else: 45 | raise newException(OSError, "Unsupported platform: " & hostOS) 46 | 47 | when not defined(release): 48 | switch("debugger", "native") 49 | -------------------------------------------------------------------------------- /nimway/src/gol.nim: -------------------------------------------------------------------------------- 1 | import random 2 | import godot 3 | import godotapi/[node_2d, position_2d, timer, packed_scene, control, scene_tree, resource_loader, button] 4 | import cell 5 | 6 | gdobj GoL of Node2D: 7 | #game board settings 8 | var width* = 10 9 | var height* = 10 10 | var grid: seq[Cell] = newSeq[Cell](self.width * self.height) 11 | var cellSize* = 32 12 | var spawnRate* = 50 13 | var spacer = 5 14 | 15 | var startPosition: Position2D 16 | var stepTimer: Timer 17 | var resetButton: Button 18 | 19 | var pk_cell = load("res://scenes/Cell.tscn") as PackedScene 20 | 21 | proc initGrid*() = 22 | for y in 0..= 0 and x < self.width and y >= 0 and y < self.height: 49 | if self.grid[y * self.width + x].getKind == CellKind.Living: 50 | result += 1 51 | 52 | #main moving cog of the game, iterate over the board and apply conway's rules 53 | proc step*() = 54 | var kinds = newSeq[CellKind](0) 55 | for y in 0.. 3: 63 | kinds.add(CellKind.Dead) 64 | else: 65 | kinds.add(CellKind.Living) 66 | #dead 67 | elif livingNeighbors == 3: 68 | kinds.add(CellKind.Living) 69 | else: 70 | kinds.add(CellKind.Dead) 71 | 72 | #set the kinds 73 | for y in 0..= 0.7.11 & < 0.8.0" --------------------------------------------------------------------------------