This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function load_map(index) | |
| -- reset the won flag | |
| won = false | |
| --reset the map | |
| for i=0,7 do | |
| for j=0,7 do | |
| mset(i,j,0) | |
| end | |
| end | |
| -- we wan to copy the indexth map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- here these numbers are a bit weird, due to how i have my sprite sheet, | |
| -- letters start at tile 16, so WIN spelled out with tile numbers is this | |
| -- sequence trust me. W = 38, I = 24 etc... | |
| sequence = {38,24,29} | |
| won = false | |
| function check_for_sequence(x,y,index) | |
| -- the char matches the winning words char | |
| if mget(x,y) == sequence[index] then | |
| -- if this is the last char in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _init() | |
| player = { | |
| x=1, | |
| y=1, | |
| direction = 5 | |
| } | |
| poke(0x5f2c,3) | |
| end | |
| directions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- I'm using sprite 1 and 2 for drawing, so draw something there | |
| units = {} | |
| cursor = { | |
| x = 1, | |
| y = 1 | |
| } | |
| bottom_of_board = 9 | |
| is_green = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "mods": | |
| [ | |
| { | |
| "name": "base", | |
| "enabled": true | |
| }, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "lua-local", | |
| "request": "launch", | |
| "name": "Debug", | |
| "program": { | |
| "command": "love" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function love.update(dt) | |
| accumulator = accumulator+dt | |
| if joystick then | |
| handle_joystick(joystick) | |
| end | |
| if accumulator >= tickPeriod then | |
| -- do update stuff | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function love.draw() | |
| local width, height = love.graphics.getDimensions() | |
| local gameScale = canvasWidth / canvasHeight | |
| local windowScale = width / height | |
| local sw, sh = width/canvasWidth, height/canvasHeight | |
| if windowScale > gameScale then | |
| drawScale = sh | |
| else | |
| drawScale = sw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if btnp(4) then | |
| local index = cursor.y*10+cursor.x | |
| -- placing something will have to consider if it is an empty spot | |
| -- and if we still have something to place (in hand is > 0 in id) | |
| if (space_map[index] == vacant) and (in_hand_object != 0) then | |
| -- if so place it | |
| space_map[cursor.y*10+cursor.x] = in_hand_object | |
| -- set our hand to "empty" | |
| in_hand_object = 0 | |
| -- only add objecst to hand if we still have them in pool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- borders around play area | |
| line(8,7,87,7,1) | |
| line(7,8,7,88,1) | |
| line(88,8,88,88,1) | |
| line(8,89,87,89,1) | |
| -- fill pattern for grid | |
| for i=1,10 do | |
| fillp(▒) | |
| --line((i*8)-1,8,(i*8),88,1) | |
| local xpos = (i*8)-1 |
NewerOlder