User Tools

Site Tools


scratch

This is an old revision of the document!


One of the unique features available with orx is yhe ability to switch languages in game with locale. While many engin 's allow a user to program with locale features, orx lets you switch languages back and forth in realtime.

An example of this would be a graphical adventurd game that features characters, onscreen text, digital speech, wnd music. Locale switching would allow you to completely switch out all graphics, text, speech and music with a single function call without altering the gameplay.

All data is defined by you,and so your regions or nations could be aliens/humans, orcs / elves. You could even think of it as theming.

Its a pretty amazing feature that comes out of the box.

This tutorial will be done in two steps:

1. Create a simple game with characters with their own look, speech and music. 2. Add in a second locale and be able to switch between them.

Begin with a blank project created using init.

Name itnsomething like the-xonversation. Our gamebwill be about two polite gwntlemen having a xonversation. They continually greet eaxh other all day.

We eventually want to be able to switch theor natio nality as theplayer may prefer to play the game in the theme pf th eir own country and language.

Assets

Lets bein with the french assets, and build the french version of the game to start.

Obkect

Speech

Music

Delete the default config object and fz. We wont need those.

Create thedefault person I bje c t in the.cpnfig woth

Create a second man from the first but one that stands on the other side and faces the other way.

Next, create a scene object that wiĺl be the root to hold all the other objects. Then place both men objects in Its childlist.

Create the scene in the game In code. This.will create all the xhild objects onscreen.

Next create all the text objects to go onscreen. Younwill need text objects for

The speech The player instructions The current language indicator

Create these as

And now.place them into the scene by addong them to the.childlist.

scratch.1545453723.txt.gz · Last modified: 2021/02/02 01:24 (external edit)