Jump to content

What is the Best way to save Bitmap data to database for Phaser to use?


thefootballguy
 Share

Recommended Posts

I am trying to save sprite data to a database and being able to change it later.  but I am having trouble figuring out how to implement this. (preferable redis)

db.hmset("graphics:dude", JSON.stringify(dudeData));

    var dudeData = [
        '.......3.....',
        '......333....',
        '....5343335..',
        '...332333333.',
        '..33333333333',
        '..37773337773',
        '..38587778583',
        '..38588888583',
        '..37888888873',
        '...333333333.',
        '.F....5556...',
        '3E34.6757.6..',
        '.E.55.666.5..',
        '......777.5..',
        '.....6..7....',
        '.....7..7....'
    ];

Then use something like JSON.parse() to get the data back?

 

Link to comment
Share on other sites

Well thanks for the help @VitaZheltyakov but I finally figured out using it just using nodejs-redis examples. However, I don't know how to access the data OUTSIDE of nodejs  main "app.js" file. If anyone can help, I will greatly appreciate it. http://stackoverflow.com/questions/37956668/how-to-access-string-data-from-redis-through-another-js-file-in-nodejs

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...