This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:guides:beginners:platforms_and_texture_repeating [2018/06/27 06:14 (7 years ago)] – sausage | en:guides:beginners:platforms_and_texture_repeating [2024/11/17 03:22 (5 months ago)] (current) – sausage | ||
---|---|---|---|
Line 23: | Line 23: | ||
And create it inside the Init() function with: | And create it inside the Init() function with: | ||
- | < | + | < |
+ | orxObject_CreateFromConfig(" | ||
orxObject_CreateFromConfig(" | orxObject_CreateFromConfig(" | ||
</ | </ | ||
Line 33: | Line 34: | ||
Great. Next, the platform needs to be stretched out so that it acts like a platform and not just a simple box. You can do this by changing the '' | Great. Next, the platform needs to be stretched out so that it acts like a platform and not just a simple box. You can do this by changing the '' | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 50: | Line 51: | ||
We also need the Repeat property, so that the texture will repeat within the object: | We also need the Repeat property, so that the texture will repeat within the object: | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 68: | Line 69: | ||
Let's move the platform to the bottom of the screen and extend it to the whole screen width: | Let's move the platform to the bottom of the screen and extend it to the whole screen width: | ||
- | < | + | < |
[PlatformObject] | [PlatformObject] | ||
Graphic | Graphic | ||
Line 78: | Line 79: | ||
We can use this as a template to create many platforms. But rather than create a few platforms in code, it would be much easier to create a single empty parent object with a few child objects under it. | We can use this as a template to create many platforms. But rather than create a few platforms in code, it would be much easier to create a single empty parent object with a few child objects under it. | ||
- | Start by making | + | Start by re-using |
- | < | + | < |
[Scene] | [Scene] | ||
ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject # | ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject # | ||
Line 91: | Line 92: | ||
< | < | ||
[MiddlePlatformObject@PlatformObject] | [MiddlePlatformObject@PlatformObject] | ||
- | Position = (250, 450, 0) | + | Position = (-150, 150, 0) |
- | Scale = (30, 2, 0) | + | Scale = (30, 2, 0) |
- | Repeat = (15, 1, 0) | + | Repeat |
[TopLeftPlatformObject@PlatformObject] | [TopLeftPlatformObject@PlatformObject] | ||
- | Position = (0, 320, 0) | + | Position = (-400, 20, 0) |
- | Scale = (14, 2, 0) | + | Scale = (14, 2, 0) |
- | Repeat = (7, 1, 0) | + | Repeat |
[TopPlatformObject@TopLeftPlatformObject] | [TopPlatformObject@TopLeftPlatformObject] | ||
- | Position = (300, 200, 0) | + | Position = (-100, -100, 0) |
[TopRightPlatformObject@TopLeftPlatformObject] | [TopRightPlatformObject@TopLeftPlatformObject] | ||
- | Position = (600, 90, 0) | + | Position = (200, -210, 0) |
</ | </ | ||
Line 113: | Line 114: | ||
Next change the code in the Init() function to create " | Next change the code in the Init() function to create " | ||
- | < | + | < |
+ | orxObject_CreateFromConfig(" | ||
orxObject_CreateFromConfig(" | orxObject_CreateFromConfig(" | ||
</ | </ |