Tetris3DS

Discussion in '3DS - Homebrew Development and Emulators' started by UltiNaruto, Sep 22, 2015.

  1. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    EDIT (28/02/2016) : The project is now discontinued! I'm working on a new project. I will give you details about this new project later.

    Tetris 3DS

    I ported this SDL game (http://www.aaroncox.net/tutorials/arcade/FallingBlocks.html) to 3DS. I had to change background because it wouldn't fit with 3DS. There's still lots to do though.

    It has 99 levels and speed increase quite fast after level 6.

    That's my first homebrew games for 3DS and I'll try to do more in the future.

    Keys

    DPad UP - Rotate block clockwise
    L Trigger - Rotate block reverted clockwise
    R Trigger - Rotate block clockwise
    DPad DOWN - Move block down faster
    DPad LEFT/RIGHT - Move block to the left/right
    A Button - Instantly drop down the block
    Start - Exit to HB Launcher
    Select - Pause the game

    v0.1a (OLD) :
    [​IMG]

    v0.305b :
    [​IMG]

    Known bugs :
    • Image is wrongly rotated (90° clockwise)
    • Colors doesn't match the PNGs attached in gfx folder
    Source
    Download
     
    Last edited by UltiNaruto, Aug 11, 2016
    ihaveamac, MannCo, Cid2mizard and 9 others like this.


  2. TheSockNaster

    TheSockNaster Kawaii

    Banned
    270
    58
    Feb 7, 2015
    United States
    Nice Job! :)
     
    UltiNaruto likes this.
  3. 730

    730 Professional Shitposter

    Member
    465
    376
    Apr 2, 2015
    Argentina
    I'm not sure since I've never done any C++, even less for 3DS, but I think you can solve the color bug converting your .pngs to .bins with this tool. This happens because the 3DS reads images in BGR color instead of RGB so it gets messed up.
     
    UltiNaruto likes this.
  4. Ericjwg

    Ericjwg Good

    Member
    2,864
    693
    Jul 2, 2015
    Canada
    nice
     
    UltiNaruto likes this.
  5. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,267
    Nov 24, 2014
    Italy
    Bologna
    You can simply switch R and B channels (some decoders like lodepng can also do this by theirselves).
     
    UltiNaruto likes this.
  6. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    Thanks for the tool. I'll try now.

    Thanks. :)

    Thanks. :)

    Well it's easier than reconverting PNGs :P

    EDIT:
    sounds like imgur.com killed my screenshot ...
    I will host it on my personal website...

    EDIT2:
    It was a bug...
     
    Last edited by UltiNaruto, Sep 22, 2015
  7. Wolfy

    Wolfy Person That Never Was

    Member
    554
    213
    Aug 18, 2015
    United States
    Somewhere In The Aether...
    This is amazing, looking forward to updates, love this game :)
     
  8. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    @730: Worse :P
    [​IMG]
    @Wolfy and others:
    Next update will have scoreboard and game will be endless till level 99.
     
  9. Wolfy

    Wolfy Person That Never Was

    Member
    554
    213
    Aug 18, 2015
    United States
    Somewhere In The Aether...

    Cool, can't wait, but rotation is something I'm hoping for if you get the time :3
     
  10. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    ah forgot to tell the keys grr xD
     
  11. 730

    730 Professional Shitposter

    Member
    465
    376
    Apr 2, 2015
    Argentina
    Well shit :rofl2: Maybe you should try not rotating the image 90º like that program does, so use @Rinnegatamante 's method, or delete the line that does that in the JavaScript app and try again.
     
  12. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    I didn't rotate it :)
    There's a box to uncheck in the script

    I tried @Rinnegatamente 's method but it freezes.
    Guess I'll stick with those colors for now until I find another way.
     
    Last edited by UltiNaruto, Sep 22, 2015
  13. 730

    730 Professional Shitposter

    Member
    465
    376
    Apr 2, 2015
    Argentina
    Then maybe you should have rotated?
     
  14. LinkMain111

    LinkMain111 GBAtemp Regular

    Member
    125
    54
    Jul 21, 2015
    Since I can't code to save my life why don't you put this on the bottom screen[​IMG]
     
    Last edited by LinkMain111, Sep 22, 2015
  15. HaloEffect17

    HaloEffect17 Splatoon Fan

    Member
    1,034
    977
    Jul 1, 2015
    Canada
    Well done, sir!
     
    UltiNaruto likes this.
  16. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    At first I wanted to use fonts on background.png but sftdlib doesn't want to compile due to unknown errors and I don't know any other viable ways to draw text on images using ctrulib. Still glad that I don't have to use sf2dlib and sfillib which are far from being optimized. Though they are very good they lack of performance.

    — Posts automatically merged - Please don't double post! —

    I added my homebrew to the list : http://wiki.gbatemp.net/wiki/List_of_3DS_homebrew
     
    Last edited by UltiNaruto, Sep 23, 2015
    HaloEffect17 likes this.
  17. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    New update available : v0.2a

    Known bugs:
    • Same as v0.1a
    Changes:
    • Replaced 5 level limit to endless (99 levels)
    • Added highscore table (saves into a file into the same folder as the executable(.3DSX/.CIA)
    • Binded Select key to pause key
     
  18. Wolfy

    Wolfy Person That Never Was

    Member
    554
    213
    Aug 18, 2015
    United States
    Somewhere In The Aether...
    Nice job with adding a pause button and the highscores :)

    Just gotta fix the Exit button bug, and maybe change the rotate button to R and L?

    Edit: Restarted N3DS running 10.0, getting an error whenever I start it up now, perhaps a problem with calling the highscores file?

    — Posts automatically merged - Please don't double post! —

    Ok, so you can fix the problem by deleting the high scores file, but it comes back after you restart.
     
    Last edited by Wolfy, Sep 23, 2015
  19. UltiNaruto
    OP

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    Yeah because of blank line. I will have to fix this when I'll be back home.

    You can fix this by removing the last line in highScores.bin.

    Edit: For the rotation buttons I'll add the L and R buttons but I'll keep the Dpad UP button for default rotation.
     
    Last edited by UltiNaruto, Sep 23, 2015
  20. Wolfy

    Wolfy Person That Never Was

    Member
    554
    213
    Aug 18, 2015
    United States
    Somewhere In The Aether...
    Thanks, I'll do it when I get the chance.