├── .gitignore ├── LICENSE ├── README.md ├── audio.wu ├── data.wu ├── event.wu ├── filesystem.wu ├── font.wu ├── graphics.wu ├── image.wu ├── init.wu ├── joystick.wu ├── keyboard.wu ├── math.wu ├── mouse.wu ├── physics.wu ├── sound.wu ├── system.wu ├── thread.wu ├── timer.wu ├── touch.wu ├── types.wu ├── video.wu ├── window.wu └── wu.toml /.gitignore: -------------------------------------------------------------------------------- 1 | *.lua 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Niels Nielsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | Wu Dragon Heart 4 | 5 |
6 | 7 |

Lover

8 |

A strongly typed Wu wrapper for the Love2D game engine.

9 | 10 | Building your games in Wu and with Lover will massively reduce runtime errors and make for better scalability. Lover provides a wide-scale Wu framework for game development through the latest version of Love2D. Let's go. 11 | 12 | ## Wu? 13 | 14 | Wu is a gradually typed, Rust-inspired programming language that compiles to Lua. The language is designed with scalability and ease-of-use in mind, originally striving to be a solid alternative to Lua and MoonScript - but with **types** and more *rusty*. 15 | 16 | ## Example 17 | 18 | ```fsharp 19 | import lover 20 | 21 | Player: struct { 22 | x: float 23 | y: float 24 | speed: float 25 | } 26 | 27 | implement Player { 28 | update: fun(self, dt: float) { 29 | if lover keyboard isDown("left") { 30 | self x -= self speed * dt 31 | } 32 | if lover keyboard isDown("right") { 33 | self x += self speed * dt 34 | } 35 | } 36 | } 37 | 38 | player := new Player { 39 | x: 100 40 | y: 100 41 | speed: 100 42 | } 43 | 44 | update: fun(dt: float) { 45 | player update(dt) 46 | } 47 | 48 | draw: fun { 49 | lover graphics push() 50 | lover graphics scale(3, 3) 51 | 52 | lover graphics setColor(1, 0, 1) 53 | lover graphics rectangle("fill", player x, player y, 20, 20) 54 | lover graphics print("Love2D but with Wu", 10, 10) 55 | 56 | lover graphics pop() 57 | } 58 | 59 | lover setUpdate(update) 60 | lover setDraw(draw) 61 | ``` 62 | 63 | ### Roadmap 64 | 65 | The current wrapper will provide you with the basic tools to make a fully functioning desktop game. The rest of the engine are being plugged in as we speak. ;) 66 | 67 | - [ ] `love.audio` 68 | - [ ] `love.data` 69 | - [ ] `love.event` 70 | - [ ] `love.filesystem` 71 | - [ ] `love.font` 72 | - [x] `love.graphics` 73 | - [ ] `love.image` 74 | - [ ] `love.joystick` 75 | - [ ] `love.keyboard` 76 | - [ ] `love.math` 77 | - [ ] `love.mouse` 78 | - [x] `love.physics` 79 | - [ ] `love.sound` 80 | - [ ] `love.system` 81 | - [ ] `love.thread` 82 | - [ ] `love.timer` 83 | - [ ] `love.touch` 84 | - [ ] `love.video` 85 | - [ ] `love.window` 86 | 87 | ### License 88 | 89 | [MIT License](https://github.com/nilq/love/blob/master/LICENSE) 90 | -------------------------------------------------------------------------------- /audio.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/audio.wu -------------------------------------------------------------------------------- /data.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/data.wu -------------------------------------------------------------------------------- /event.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/event.wu -------------------------------------------------------------------------------- /filesystem.wu: -------------------------------------------------------------------------------- 1 | import types { Object_T, Data } 2 | 3 | 4 | 5 | # BufferMode: enum {"none", "line", "full"} 6 | # FileMode: enum {"r", "w", "a", "c"} 7 | # ContainerType: enum {"data", "string"} 8 | 9 | 10 | File: struct {} 11 | 12 | File_T: trait { 13 | close: fun(self) -> bool 14 | flush: fun(self) -> (bool, str?) 15 | getBuffer: fun(self) -> (str, int) # fun(self) -> (BufferMode, int) 16 | getFilename: fun(self) -> str 17 | getMode: fun(self) -> str # fun(self) -> FileMode 18 | getSize: fun(self) -> int 19 | isEOF: fun(self) -> bool 20 | isOpen: fun(self) -> bool 21 | lines: fun(self) -> fun 22 | open: fun(self, str) -> (bool, str?) # fun(self, FileMode) -> (bool, str?) 23 | read: fun(self, str, int?) -> (any, int) # (self, int|ContainerType, int?) -> (str|FileData, int) 24 | seek: fun(self, int) -> bool 25 | setBuffer: fun(self, str, int?) -> (bool, str?) # fun(self, BufferMode, int?) -> (bool, str?) 26 | tell: fun(self) -> int 27 | write: fun(self, any, int?) -> (bool, str?) # (self, str|Data, int?) -> bool, str? 28 | } 29 | 30 | implement File: Object_T { 31 | release: extern fun(self) -> bool 32 | type: extern fun(self) -> str 33 | typeOf: extern fun(self, str) -> bool 34 | } 35 | 36 | implement File: File_T { 37 | close: extern fun(self) -> bool 38 | flush: extern fun(self) -> (bool, str?) 39 | getBuffer: extern fun(self) -> (str, int) # fun(self) -> (BufferMode, int) 40 | getFilename: extern fun(self) -> str 41 | getMode: extern fun(self) -> str # fun(self) -> FileMode 42 | getSize: extern fun(self) -> int 43 | isEOF: extern fun(self) -> bool 44 | isOpen: extern fun(self) -> bool 45 | lines: extern fun(self) -> fun 46 | open: extern fun(self, str) -> (bool, str?) # fun(self, FileMode) -> (bool, str?) 47 | read: extern fun(self, str, int?) -> (any, int) # (self, int|ContainerType, int?) -> (str|FileData, int) 48 | seek: extern fun(self, int) -> bool 49 | setBuffer: extern fun(self, str, int?) -> (bool, str?) # fun(self, BufferMode, int?) -> (bool, str?) 50 | tell: extern fun(self) -> int 51 | write: extern fun(self, any, int?) -> (bool, str?) # (self, str|Data, int?) -> bool, str? 52 | } 53 | 54 | 55 | 56 | DroppedFile: struct {} 57 | 58 | implement DroppedFile: Object_T { 59 | release: extern fun(self) -> bool 60 | type: extern fun(self) -> str 61 | typeOf: extern fun(self, str) -> bool 62 | } 63 | 64 | implement DroppedFile: File_T { 65 | close: extern fun(self) -> bool 66 | flush: extern fun(self) -> (bool, str?) 67 | getBuffer: extern fun(self) -> (str, int) # fun(self) -> (BufferMode, int) 68 | getFilename: extern fun(self) -> str 69 | getMode: extern fun(self) -> str # fun(self) -> FileMode 70 | getSize: extern fun(self) -> int 71 | isEOF: extern fun(self) -> bool 72 | isOpen: extern fun(self) -> bool 73 | lines: extern fun(self) -> fun 74 | open: extern fun(self, str) -> (bool, str?) # fun(self, FileMode) -> (bool, str?) 75 | read: extern fun(self, str, int?) -> (any, int) # (self, int|ContainerType, int?) -> (str|FileData, int) 76 | seek: extern fun(self, int) -> bool 77 | setBuffer: extern fun(self, str, int?) -> (bool, str?) # fun(self, BufferMode, int?) -> (bool, str?) 78 | tell: extern fun(self) -> int 79 | write: extern fun(self, any, int?) -> (bool, str?) # (self, str|Data, int?) -> bool, str? 80 | } 81 | -------------------------------------------------------------------------------- /font.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/font.wu -------------------------------------------------------------------------------- /graphics.wu: -------------------------------------------------------------------------------- 1 | import types { Object_T, Data_T } 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /image.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/image.wu -------------------------------------------------------------------------------- /init.wu: -------------------------------------------------------------------------------- 1 | import audio 2 | import data 3 | import event 4 | import filesystem 5 | import font 6 | import graphics 7 | import image 8 | import joystick 9 | import keyboard 10 | import math 11 | import mouse 12 | import physics 13 | import sound 14 | import system 15 | import thread 16 | import timer 17 | import touch 18 | import video 19 | import window 20 | import types { Config } 21 | 22 | 23 | # TODO: update signatures when sum types are implemented 24 | # TODO: update signatures when enums are implemented 25 | 26 | 27 | # FUNCTIONS ----------------------------------------------------------------------------- 28 | 29 | getVersion: extern fun() -> (int, int, int, str) 30 | hasDeprecationOutput: extern fun() -> bool 31 | isVersionCompatible: extern fun(any, int?, int?) -> bool # fun(str|int?, int?, int?) -> bool 32 | setDeprecationOutput: extern fun(bool) -> nil 33 | 34 | 35 | 36 | # CALLBACKS ----------------------------------------------------------------------------- 37 | 38 | # general 39 | 40 | conf: extern fun(Config) -> nil 41 | displayrotated: extern fun(int, str) -> nil # fun(int, window DisplayOrientation) -> nil 42 | draw: extern fun() -> nil 43 | errhandler: extern fun(str) -> nil 44 | load: extern fun(any?, any?) -> nil 45 | lowmemory: extern fun() -> nil 46 | quit: extern fun() -> bool 47 | run: extern fun() -> fun 48 | threaderror: extern fun(thread Thread, str) -> nil 49 | update: extern fun(float) -> nil 50 | 51 | # window 52 | 53 | directorydropped: extern fun(str) -> nil 54 | filedropped: extern fun(filesystem DroppedFile) -> nil 55 | focus: extern fun(bool) -> nil 56 | mousefocus: extern fun(bool) -> nil 57 | resize: extern fun(int, int) -> nil 58 | visible: extern fun(bool) -> nil 59 | 60 | # keyboard 61 | 62 | keypressed: extern fun(str, str, bool) -> nil # fun(keyboard KeyConstant, keyboard Scancode, bool) 63 | keyreleased: extern fun(str, str) -> nil # fun(keyboard KeyConstant, keyboard Scancode) -> nil 64 | textedited: extern fun(str, int, int) -> nil 65 | textinput: extern fun(str) -> nil 66 | 67 | # mouse 68 | mousemoved: extern fun(int, int, int, int, bool) -> nil 69 | mousepressed: extern fun(int, int, int, bool, int) -> nil 70 | mousereleased: extern fun(int, int, int, bool, int) -> nil 71 | wheelmoved: extern fun(int, int) -> nil 72 | 73 | # joystick 74 | 75 | gamepadaxis: extern fun(joystick Joystick, str, float) -> nil # fun(joystick Joystick, joystick GamepadAxis, float) -> nil 76 | gamepadpressed: extern fun(joystick Joystick, str) -> nil # fun(joystick Joystick, joystick GamepadButton) -> nil 77 | gamepadreleased: extern fun(joystick Joystick, str) -> nil # fun(joystick Joystick, joystick GamepadButton) -> nil 78 | joystickadded: extern fun(joystick Joystick) -> nil 79 | joystickaxis: extern fun(joystick Joystick, int, float) -> nil 80 | joystickhat: extern fun(joystick Joystick, int, str) -> nil # fun(joystick Joystick, int, joystick JoystickHat) -> nil 81 | joystickpressed: extern fun(joystick Joystick, int) 82 | joystickreleased: extern fun(joystick Joystick, int) 83 | joystickremoved: extern fun(joystick Joystick) -> nil 84 | 85 | # touch 86 | 87 | touchmoved: extern fun(any, int, int, int, int, float) 88 | touchpressed: extern fun(any, int, int, int, int, float) 89 | touchreleased: extern fun(any, int, int, int, int, float) 90 | -------------------------------------------------------------------------------- /joystick.wu: -------------------------------------------------------------------------------- 1 | import types { Object_T } 2 | 3 | 4 | 5 | # GamepadAxis: enum {"leftx", "lefty", "rightx", "righty", "triggerleft", "triggerright"} 6 | # GamepadButton: enum {"a","b","x","y","back","guide","start","leftstick","rightstick","leftshoulder","rightshoulder","dpup","dpdown","dpleft","dpright"} 7 | # JoystickHat: enum {"c", "d", "l", "ld", "lu", "r", "rd", "ru", "u"} 8 | # JoystickInputType: enum {"axis", "button", "hat"} 9 | 10 | 11 | 12 | Joystick: struct {} 13 | 14 | Joystick_T: trait { 15 | getAxes: fun(self) -> ...float 16 | getAxis: fun(self, int) -> float 17 | getAxisCount: fun(self) -> int 18 | getButtonCount: fun(self) -> int 19 | getConnectedIndex: fun(self) -> int? 20 | getDeviceInfo: fun(self) -> (int, int, int) 21 | getGUID: fun(self) -> str 22 | getGamepadAxis: fun(self, str) -> int # fun(self, GamepadAxis) -> int 23 | getGamepadMapping: fun(self, any) -> (str, int, str?) # fun(self, GamepadAxis|GamepadButton) -> (JoystickInputType, int, JoystickHat?) 24 | getGamepadMappingString: fun(self) -> str? 25 | getHat: fun(self, int) -> str # fun(self, int) -> JoystickHat 26 | getHatCount: fun(self) -> int 27 | getID: fun(self) -> (int, int?) 28 | getName: fun(self) -> str 29 | getVibration: fun(self) -> (float, float) 30 | isConnected: fun(self) -> bool 31 | isDown: fun(self, ...int) -> bool 32 | isGamepad: fun(self) -> bool 33 | isGamepadDown: fun(self, ...str) -> bool # fun(self, ...GamepadButton) -> bool 34 | isVibrationSupported: fun(self) -> bool 35 | setVibration: fun(self, float?, float?, float?) -> bool 36 | } 37 | 38 | implement Joystick: Object_T { 39 | release: extern fun(self) -> bool 40 | type: extern fun(self) -> str 41 | typeOf: extern fun(self, str) -> bool 42 | } 43 | 44 | implement Joystick: Joystick_T { 45 | getAxes: extern fun(self) -> ...float 46 | getAxis: extern fun(self, int) -> float 47 | getAxisCount: extern fun(self) -> int 48 | getButtonCount: extern fun(self) -> int 49 | getConnectedIndex: extern fun(self) -> int? 50 | getDeviceInfo: extern fun(self) -> (int, int, int) 51 | getGUID: extern fun(self) -> str 52 | getGamepadAxis: extern fun(self, str) -> int # fun(self, GamepadAxis) -> int 53 | getGamepadMapping: extern fun(self, any) -> (str, int, str?) # fun(self, GamepadAxis|GamepadButton) -> (JoystickInputType, int, JoystickHat?) 54 | getGamepadMappingString: extern fun(self) -> str? 55 | getHat: extern fun(self, int) -> str # fun(self, int) -> JoystickHat 56 | getHatCount: extern fun(self) -> int 57 | getID: extern fun(self) -> (int, int?) 58 | getName: extern fun(self) -> str 59 | getVibration: extern fun(self) -> (float, float) 60 | isConnected: extern fun(self) -> bool 61 | isDown: extern fun(self, ...int) -> bool 62 | isGamepad: extern fun(self) -> bool 63 | isGamepadDown: extern fun(self, ...str) -> bool # fun(self, ...GamepadButton) -> bool 64 | isVibrationSupported: extern fun(self) -> bool 65 | setVibration: extern fun(self, float?, float?, float?) -> bool 66 | } 67 | -------------------------------------------------------------------------------- /keyboard.wu: -------------------------------------------------------------------------------- 1 | # KeyConstant: enum {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","space","!","'","#","$","&","\"","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_","`","kp0","kp1","kp2","kp3","kp4","kp5","kp6","kp7","kp8","kp9","kp.","kp,","kp/","kp*","kp-","kp+","kpenter","kp=","up","down","right","left","home","end","pageup","pagedown","insert","backspace","tab","clear","return","delete","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","f13","f14","f15","f16","f17","f18","numlock","capslock","scrolllock","rshift","lshift","rctrl","lctrl","ralt","lalt","rgui","lgui","mode","www","mail","calculator","computer","appsearch","apphome","appback","appforward","apprefresh","appbookmarks","pause","escape","help","printscreen","sysreq","menu","application","power","currencyunit","undo"} 2 | # Scancode: enum {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0","return","escape","backspace","tab","space","-","=","[","]","\\","nonus#",";","\"","`",",",".","/","capslock","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20","f21","f22","f23","f24","lctrl","lshift","lalt","lgui","rctrl","rshift","ralt","rgui","printscreen","scrolllock","pause","insert","home","numlock","pageup","delete","end","pagedown","right","left","down","up","nonusbackslash","application","execute","help","menu","select","stop","again","undo","cut","copy","paste","find","kp/","kp*","kp-","kp+","kp=","kpenter","kp1","kp2","kp3","kp4","kp5","kp6","kp7","kp8","kp9","kp0","kp.","international1","international2","international3","international4","international5","international6","international7","international8","international9","lang1","lang2","lang3","lang4","lang5","mute","volumeup","volumedown","audionext","audioprev","audiostop","audioplay","audiomute","mediaselect","www","mail","calculator","computer","acsearch","achome","acback","acforward","acstop","acrefresh","acbookmarks","power","brightnessdown","brightnessup","displayswitch","kbdillumtoggle","kbdillumdown","kbdillumup","eject","sleep","alterase","sysreq","cancel","clear","prior","return2","separator","out","oper","clearagain","crsel","exsel","kp00","kp000","thsousandsseparator","decimalseparator","currencyunit","currencysubunit","app1","app2","unknown"} 3 | -------------------------------------------------------------------------------- /math.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/math.wu -------------------------------------------------------------------------------- /mouse.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/mouse.wu -------------------------------------------------------------------------------- /physics.wu: -------------------------------------------------------------------------------- 1 | Fixture: trait {} 2 | World: trait {} 3 | Shape: trait {} 4 | 5 | ChainShape: trait {} 6 | CircleShape: trait {} 7 | EdgeShape: trait {} 8 | PolygonShape: trait {} 9 | 10 | Joint: trait {} 11 | 12 | DistanceJoint: trait {} 13 | FrictionJoint: trait {} 14 | GearJoint: trait {} 15 | MotorJoint: trait {} 16 | MouseJoint: trait {} 17 | PrismaticJoint: trait {} 18 | PulleyJoint: trait {} 19 | RevoluteJoint: trait {} 20 | RopeJoint: trait {} 21 | WeldJoint: trait {} 22 | WheelJoint: trait {} 23 | 24 | Contact: trait { 25 | getChildren: fun(self) -> ...float 26 | getFixtures: fun(self) -> ...Fixture 27 | getFriction: fun(self) -> float 28 | getNormal: fun(self) -> ...float 29 | getPositions: fun(self) -> ...float 30 | getRestitution: fun(self) -> float 31 | isEnabled: fun(self) -> bool 32 | isTouching: fun(self) -> bool 33 | resetFriction: fun(self) 34 | resetRestitution: fun(self) 35 | setEnabled: fun(self, bool) 36 | setFriction: fun(self, float) 37 | setRestitution: fun(self, float) 38 | release: fun(self) -> bool 39 | type: fun(self) -> str 40 | typeOf: fun(self, str) -> bool 41 | } 42 | 43 | 44 | Body: trait { 45 | applyAngularImpulse: fun(self, float) 46 | applyForce: fun(self, float, float) 47 | applyImpulse: fun(self, float, float, float, float) 48 | applyLinearImpulse: fun(self, float, float) 49 | applyTorque: fun(self, float) 50 | destroy: fun(self) 51 | getAngle: fun(self) -> float 52 | getAngularDamping: fun(self) -> float 53 | getAngularVelocity: fun(self) -> float 54 | getContacts: fun(self) -> [Contact] 55 | getFixtures: fun(self) -> [Fixture] 56 | getGravityScale: fun(self) -> float 57 | getInertia: fun(self) -> float 58 | getJoints: fun(self) -> [Joint] 59 | getLinearDamping: fun(self) -> float 60 | getLinearVelocity: fun(self) -> ...float 61 | getLinearVelocityFromLocalPoint: fun(self, float, float) -> ...float 62 | getLinearVelocityFromWorldPoint: fun(self, float, float) -> ...float 63 | getLocalCenter: fun(self) -> ...float 64 | getLocalPoint: fun(self, float, float) -> ...float 65 | getMass: fun(self) -> float 66 | getLocalVector: fun(self, float, float) -> ...float 67 | getMassData: fun(self) -> ...float 68 | getPosition: fun(self) -> ...float 69 | getType: fun(self) -> str 70 | getUserData: fun(self) -> any 71 | getWorld: fun(self) -> World 72 | getWorldCenter: fun(self) -> ...float 73 | getWorldPoint: fun(self, float, float) -> ...float 74 | getWorldPoints: fun(self, ...float) -> ...float 75 | getWorldVector: fun(self, float, float) -> ...float 76 | getX: fun(self) -> float 77 | getY: fun(self) -> float 78 | isActive: fun(self) -> bool 79 | isAwake: fun(self) -> bool 80 | isBullet: fun(self) -> bool 81 | isDestroyed: fun(self) -> bool 82 | isFixedRotation: fun(self) -> bool 83 | isSleepingAllowed: fun(self) -> bool 84 | isTouching: fun(self, Body) -> bool 85 | resetMassData: fun(self) 86 | setActive: fun(self, bool) 87 | setAngle: fun(self, float) 88 | setAngularDamping: fun(self, float) 89 | setAngularVelocity: fun(self, float) 90 | setAwake: fun(self, bool) 91 | setBullet: fun(self, bool) 92 | setFixedRotation: fun(self, bool) 93 | setGravityScale: fun(self, float) 94 | setInertia: fun(self, float) 95 | setLinearDamping: fun(self, float) 96 | setLinearVelocity: fun(self, float, float) 97 | setMass: fun(self, float) 98 | setMassData: fun(self, float, float, float, float) 99 | setPosition: fun(self, float, float) 100 | setSleepingAllowed: fun(self, bool) 101 | setType: fun(self, str) 102 | setUserData: fun(self, any) 103 | setX: fun(self, float) 104 | setY: fun(self, float) 105 | wakeUp: fun 106 | } 107 | 108 | # END OF TYPES 109 | 110 | getDistance: extern fun(Fixture, Fixture) -> ...float 111 | getMeter: extern fun -> float 112 | newBody: extern fun(World, float, float, str) -> Body 113 | newChainShape: extern fun(bool, ...float) -> ChainShape 114 | newCircleShape: extern fun(float) -> CircleShape 115 | newDistanceJoint: extern fun(Body, Body, float, float, float, float, bool) -> DistanceJoint 116 | newEdgeShape: extern fun(float, float, float, float) -> EdgeShape 117 | newFixture: extern fun(Body, Shape, float) -> Fixture 118 | newFrictionJoint: extern fun(Body, Body, float, float, bool) -> FrictionJoint 119 | newGearJoint: extern fun(Joint, Joint, float, bool) -> GearJoint 120 | newMotorJoint: extern fun(Body, Body, float) -> MotorJoint 121 | newMouseJoint: extern fun(Body, float, float) -> MouseJoint 122 | newPolygonShape: extern fun(...float) -> PolygonShape 123 | newPrismaticJoint: extern fun(Body, Body, float, float, float, float, bool) -> PrismaticJoint 124 | newPulleyJoint: extern fun(Body, Body, float, float, float, float, float, float, float, float, float, bool) -> PulleyJoint 125 | newRectangleShape: extern fun(float, float) -> PolygonShape 126 | newRevoluteJoint: extern fun(Body, Body, float, float, bool) -> RevoluteJoint 127 | newRopeJoint: extern fun(Body, Body, float, float, float, float, float, bool) -> RopeJoint 128 | newWeldJoint: extern fun(Body, Body, float, float, bool) -> WeldJoint 129 | newWheelJoint: extern fun(Body, Body, float, float, float, float, bool) -> WheelJoint 130 | newWorld: extern fun(float, float, bool) -> World 131 | setMeter: extern fun(float) -------------------------------------------------------------------------------- /sound.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/sound.wu -------------------------------------------------------------------------------- /system.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/system.wu -------------------------------------------------------------------------------- /thread.wu: -------------------------------------------------------------------------------- 1 | import types { Object_T } 2 | 3 | 4 | 5 | Thread: struct {} 6 | 7 | Thread_T: trait { 8 | getError: fun(self) -> str? 9 | isRunning: fun(self) -> bool 10 | start: fun(self, ...) -> nil 11 | wait: fun(self) -> nil 12 | } 13 | 14 | implement Thread: Object_T { 15 | release: extern fun(self) -> bool 16 | type: extern fun(self) -> str 17 | typeOf: extern fun(self, str) -> bool 18 | } 19 | 20 | implement Thread: Thread_T { 21 | getError: extern fun(self) -> str? 22 | isRunning: extern fun(self) -> bool 23 | start: extern fun(self, ...) -> nil 24 | wait: extern fun(self) -> nil 25 | } 26 | -------------------------------------------------------------------------------- /timer.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/timer.wu -------------------------------------------------------------------------------- /touch.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/touch.wu -------------------------------------------------------------------------------- /types.wu: -------------------------------------------------------------------------------- 1 | Object: struct {} 2 | 3 | Object_T: trait { 4 | release: fun(self) -> bool 5 | type: fun(self) -> str 6 | typeOf: fun(self, str) -> bool 7 | } 8 | 9 | implement Object: Object_T { 10 | release: extern fun(self) -> bool 11 | type: extern fun(self) -> str 12 | typeOf: extern fun(self, str) -> bool 13 | } 14 | 15 | 16 | 17 | Data: struct {} 18 | 19 | Data_T: trait { 20 | clone: fun(self, Data) -> int 21 | getFFIPointer: fun(self) -> any 22 | getPointer: fun(self) -> any 23 | getSize: fun(self) -> int 24 | getString: fun(self) -> str 25 | } 26 | 27 | implement Data: Data_T { 28 | clone: extern fun(self, Data) -> int 29 | getFFIPointer: extern fun(self) -> any 30 | getPointer: extern fun(self) -> any 31 | getSize: extern fun(self) -> int 32 | getString: extern fun(self) -> str 33 | } 34 | 35 | implement Data: Object_T { 36 | release: extern fun(self) -> bool 37 | type: extern fun(self) -> str 38 | typeOf: extern fun(self, str) -> bool 39 | } 40 | 41 | 42 | 43 | AudioConfig: struct { 44 | mic: bool # Request and use microphone capabilities in Android (boolean) 45 | mixwithsystem: bool # Keep background music playing when opening LOVE (boolean, iOS and Android only) 46 | } 47 | 48 | WindowConfig: struct { 49 | title: str # The window title (string) 50 | icon: str? # Filepath to an image to use as the window's icon (string) 51 | width: int # The window width (number) 52 | height: int # The window height (number) 53 | borderless: bool # Remove all border visuals from the window (boolean) 54 | resizable: bool # Let the window be user-resizable (boolean) 55 | minwidth: int # Minimum window width if the window is resizable (number) 56 | minheight: int # Minimum window height if the window is resizable (number) 57 | fullscreen: bool # Enable fullscreen (boolean) 58 | fullscreentype: str # Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string) 59 | vsync: int # Vertical sync mode (number) 60 | msaa: int # The number of samples to use with multi-sampled antialiasing (number) 61 | depth: int? # The number of bits per sample in the depth buffer 62 | stencil: int? # The number of bits per sample in the stencil buffer 63 | display: int # Index of the monitor to show the window in (number) 64 | highdpi: bool # Enable high-dpi mode for the window on a Retina display (boolean) 65 | usedpiscale: bool # Enable automatic DPI scaling when highdpi is set to true as well (boolean) 66 | x: int? # The x-coordinate of the window's position in the specified display (number) 67 | y: int? # The y-coordinate of the window's position in the specified display (number) 68 | } 69 | 70 | ModuleConfig: struct { 71 | audio: bool # Enable the audio module (boolean) 72 | data: bool # Enable the data module (boolean) 73 | event: bool # Enable the event module (boolean) 74 | font: bool # Enable the font module (boolean) 75 | graphics: bool # Enable the graphics module (boolean) 76 | image: bool # Enable the image module (boolean) 77 | joystick: bool # Enable the joystick module (boolean) 78 | keyboard: bool # Enable the keyboard module (boolean) 79 | math: bool # Enable the math module (boolean) 80 | mouse: bool # Enable the mouse module (boolean) 81 | physics: bool # Enable the physics module (boolean) 82 | sound: bool # Enable the sound module (boolean) 83 | system: bool # Enable the system module (boolean) 84 | thread: bool # Enable the thread module (boolean) 85 | timer: bool # Enable the timer module (boolean), Disabling it will result 0 delta time in love.update 86 | touch: bool # Enable the touch module (boolean) 87 | video: bool # Enable the video module (boolean) 88 | window: bool # Enable the window module (boolean) 89 | } 90 | 91 | Config: struct { 92 | identity: str? # The name of the save directory (string) 93 | appendidentity: bool # Search files in source directory before save directory (boolean) 94 | version: str # The LÖVE version this game was made for (string) 95 | console: bool # Attach a console (boolean, Windows only) 96 | accelerometerjoystick: bool # Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean) 97 | externalstorage: bool # True to save files (and read from the save directory) in external storage on Android (boolean) 98 | gammacorrect: bool # Enable gamma-correct rendering, when supported by the system (boolean) 99 | audio: AudioConfig # Audio configuration 100 | window: WindowConfig # Window configuration 101 | modules: ModuleConfig # Module configuration 102 | } 103 | -------------------------------------------------------------------------------- /video.wu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wu-lang/lover/6bb0986bab3febade528df87029f43eb432a60d2/video.wu -------------------------------------------------------------------------------- /window.wu: -------------------------------------------------------------------------------- 1 | # DisplayOrientation: enum {"unknown","landscape","landscapeflipped","portrait","portraitflipped"} 2 | -------------------------------------------------------------------------------- /wu.toml: -------------------------------------------------------------------------------- 1 | [dependencies] 2 | --------------------------------------------------------------------------------