Log In  
Follow
dagondev

Masters skill of finishing at least one game.

dagondev.com/
@dagondev Twitter


Cart #34286 | 2016-12-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hello everyone.

As I was writing Save Yourself I needed some proper debugging methods to speed up finding bugs. Because my game was almost over token and char limit I had to completely scrap debug code at the end of the cycle. So I thought moving this debug to other cart may help someone in same need as I was.

FEATURES:

  • Prints messages with time (in seconds) attached.
  • Deals with strings, numbers and nils
  • Ability to control number of messages shown
  • Ability to use spam filter - useful when you debug something every frame
  • Show cpu consuption for update and draw method
  • Have space for player coordinates and additional info visible below messages

Code is non minified and commented. Feel free to ask questions.

GIF from Save Yourself showing how debug looked in game:

[ Continue Reading.. ]

6
0 comments



Cart #34857 | 2017-01-03 | Code ▽ | Embed ▽ | No License
13

Save Yourself v1.0c

Short adventure game with unique talking mechanic with focus on exploring and talking to NPCs. Meant to be played several times to learn the world and find clues. Game have random elements to throw player off from obvious resolution.
As it was my first released game it isn't very player friendly and is very obtuse in what it requires from you.

One run length: 5-20 minutes

INTRO:
You are one of many bounty hunters that is after Maggus, the royal mage, after you found King will pay handsomely for this task.
Allied mercenary lead you to enclosed, old, valley mine, where Maggus could hide.
This is your chance, there is only one exit from this place and your companion is guarding it.

[ Continue Reading.. ]

13
12 comments



Hello, I am hitting token count with my game so often - it is irritating. I feel like I am fighting a war of having clean code vs having less tokens.
(I understand that pico8 is for small games and first step should be cutting features though)
I am not sure if something is wrong or am I expecting too much and trying to use pico8 like modern framework.

In the docs is stated:
One program can have a maximum of 8192 tokens. Each token is a word (e.g. variable name) or operator. Pairs of brackets, and strings count as 1 token. commas, periods, LOCALs, semi-colons, ENDs, and comments are not counted.

Let's look at this code:
(taken from my game, but shortened and altered - don't expect this to work! I am not saying that provided code is greatest piece of clean, descriptive code!)

It draws (on local space - screen) piece of text, npc will say to the player - after delay, with black background to ensure readability.

  draw_say=function(this,x,y)
    x=this.x-x
    y=this.y-y
    palt(0,false)
    foreach(this.draw_message_queue,function(obj)
        local deltatime=gl_app_time.timeelapsed-obj.time
        local text_len=#obj.m
        local text_size=text_len*2
        local text_time=text_len/4.0
        local x1=x-text_size-2
        local x2=x+text_size+2
        local y1=y-12
        local y2=y-4

        if deltatime<text_time then
          rectfill(x1,y1,x2,y2,0)
          print(obj.m,x1,y1+2,obj.color)
        end
      end)
    palt()
  end,

[ Continue Reading.. ]

3
11 comments