Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TheEndless
Channel Surfer

Re: New project Prince of Persia (soon will be open sourced)

"marcelo.cabral" wrote:
I'm using 854x480 but the original size of the game is 320x200, that's why it still shows small

BTW can I set 640x480 with the Roku on HD 720 mode ? never tried, assumed with the documentation that this mode would only be available on SD

You can, but if you're already using 854x480, it won't make much difference aside from stretching it horizontally.
"marcelo.cabral" wrote:
Another issue I had was to flip the sprites horizontally, I don't know if there is a way to do this on the API (I only see we can rotate, not flip), so the solution was to create two sets of sprites.

If I had a way to flip would save a lot of space on the package.

There's no built in way to flip an entire image, but you could do it programmatically by copying the sprite to a new bitmap one row/column at a time using roRegion. I did something similar to produce a reflection effect.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

I got it done, had to reformat the kid sprite pack to be able to double its size and stay inside the bitmap max limits:

http://lvcabral.com/images/screenshot-20-20160329.jpg
0 Kudos
EnTerr
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

How is the sound generated?
Also i wonder, given someone made a javascript version (vs 6502 asm) - wouldn't it be "easy" to write an interpreter/(trans)compiler for that?
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

"EnTerr" wrote:
How is the sound generated?

Well, this was another aspect of Roku I wasn't aware of, it only allow 2 audio streams playing at the same time, one wav with roAudioResource and another with roAudioPlayer.
So I basically added the short sound effects as wav (roAudioResource) and some other effects/songs as mp3 (roAudioPlayer).

"EnTerr" wrote:
Also i wonder, given someone made a javascript version (vs 6502 asm) - wouldn't it be "easy" to write an interpreter/(trans)compiler for that?


That's a good point, the original Javascript code uses Phaser HTML5 framework for games, and I created a simple Notepad++ macro that helped me to translate most of the JS->BS sintaxes, and I believe it's feasible to create a more inteligent tool to make this conversion, would be an interesting project.
0 Kudos
Komag
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

It's unofficial, but some Rokus give you two audio channels to work with
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

Implemented death by chopper and spikes, and added several missing audio effects. Soon v0.7 will be released.

https://www.instagram.com/p/BDwyHTukM9R/
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

I have a roadmap planned to release the source code:

April 10th - v0.7 - Classic Mode scaled to 640x400, death on Slicer/Spikes, injury by falling plates, Crop/Mask fixes
April 30th - v0.8 - Slow Fall Potion, Screen Flip Potion, Guards Fight, Save Game
May 30th - v0.9 - (release to GitHub) Cut Scenes, Special Enemies, End of the game (Level 12-13-14), Documentation

A great coincidence (or not) is that May 30th is my birthday 😉

I'm not sure I''ll have time to implement all, but I will release "as-is" and hope people will help me finish it
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (soon will be open sourced)

I just published version 0.7 whoever requested the link to the private preview channel will get it automatically, I will make a new video with the changes soon.

The changeset of this release is the following:

0.7 - Classic Mode scaled, Die on Slicer/Spikes, Injury by Falling Plates and Mask/Crop fixes

* Add: Classic Mode scaled 2X to be painted in 640x400
* Add: Control options adapted for remote controls without the buttons: Replay, A and B
* Add: Kid will die when running or falling on spikes
* Add: Kid will die when crossing a slicer in the wrong time
* Add: Kid will be injured from falling plate
* Add: Game sound effects: spiked, death, slicer, long fall, harm
* Add: Menu sound effects: menu navigation, menu select
* Add: When level starts in front of an exit door, drop it!
* Add: Turn the kid direction when a level starts
* Add: Use "medland" action on the first level and first room before the "suspense" sound
* Add: Gray border around the game area
* Add: VersionInfo added to the bottom right corner of the screen
* Add: Level transition by falling - not on JS - (L6-L7)
* Refactor: Renamed Chopper tile to Slicer following original Apple II code naming convention
* Refactor: Added a priority system to play the sound effects
* Refactor: Removed deprecated method LoadSpriteAnimations()
* Refactor: Removed the 320x200 mode and the game frame
* Fix: Kid level start horizontal position is wrong
* Fix: Kid can't jump in front of a closed exit door
* Fix: Status bar text center not aligned based on actual text width
* Fix: After death max lives are not restored to 3
* Fix: Gate tile "front sprite" is stuck down when gate is off the screen
* Fix: Slicer should only start when the kid is on the same elevation and room
* Fix: Kid is pressing a button when hanging on a level below (L1R5)
* Fix: Splash showing in the wrong position when kid is standing (L8)
* Fix: Hang on loose plate do not make it fall (same bug on JS code)
* Fix: Hanging on a tapestry do not consider it solid, bouncing into it (same bug on JS code)
* Fix: Pushing plates and fall keep debris on top (L4R16-R17)
* Fix: Walk is not considering the risk of slicer
* Fix: Crash when changing level when a plate is falling (L1R1-R2)
* Fix: Room transition is not exact (horizontally or vertically) - classic only
* Fix: 9 rooms mode does not draw ok when navigating vertically (L2, L9)
* Fix: Gate opening not cropped above ceiling when in multi-room mode (L2)
* Fix: Some artifacts over floor in some rooms (rooms painted in wrong order)
* Fix: In shift mode if you turn and keep pressing the kid runs (same bug on JS code)
* Fix: Mask issues: Jump crossing up ceiling
* Fix: Mask issues: Falling edge crosses the floor
* Fix: Mask issues: Kid hands showing when climb up/down and hanging
0 Kudos
EnTerr
Roku Guru

Re: New project Prince of Persia (will be open sourced May 3

Version info is too much in the corner, that edge gets chopped off when TV is in overscan mode. Somewhat cryptically (un)explained at https://sdkdocs.roku.com/display/sdkdoc ... 2Safezones - but as rule of thumb be ready for up to 5% on each side of the image might be chopped off by the TV. Yes, many/most digital TVs still do that by default, long established tradition.

I notice once chosen, can't go back to change the game mode from 1x1 to 2x2 or 3x3 but perhaps that's intentional. The zoomed 1x1 mode - now that feels more the real thing!
0 Kudos
marcelo_cabral
Roku Guru

Re: New project Prince of Persia (will be open sourced May 3

"EnTerr" wrote:
Version info is too much in the corner, that edge gets chopped off when TV is in overscan mode. Somewhat cryptically (un)explained at https://sdkdocs.roku.com/display/sdkdoc ... 2Safezones - but as rule of thumb be ready for up to 5% on each side of the image might be chopped off by the TV. Yes, many/most digital TVs still do that by default, long established tradition.

I notice once chosen, can't go back to change the game mode from 1x1 to 2x2 or 3x3 but perhaps that's intentional. The zoomed 1x1 mode - now that feels more the real thing!


I know that the version is too close to the edges, that thing is more a reference for me when developing, I don't think I will keep that anyway.

Next release I will make it possible to hit the back button to come back to the menu.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.