User Tools

Site Tools


en:guides:beginners:platforms_and_texture_repeating

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:guides:beginners:platforms_and_texture_repeating [2019/02/19 03:53 (6 years ago)] – Fixed incorrect platform coordinates. Thanks to songproducer for reporting! sausageen: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:
  
-<code=ini>+<code=ini [highlight_lines_extra="2"]> 
 +orxObject_CreateFromConfig("HeroObject");
 orxObject_CreateFromConfig("PlatformObject"); orxObject_CreateFromConfig("PlatformObject");
 </code> </code>
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 ''Scale'' property: 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 ''Scale'' property:
  
-<code=ini>+<code=ini [highlight_lines_extra="4"]>
 [PlatformObject] [PlatformObject]
 Graphic  = PlatformGraphic Graphic  = PlatformGraphic
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:
  
-<code=ini>+<code=ini [highlight_lines_extra="5"]>
 [PlatformObject] [PlatformObject]
 Graphic  = PlatformGraphic Graphic  = PlatformGraphic
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:
  
-<code=ini>+<code=ini [highlight_lines_extra="3,4,5"]>
 [PlatformObject] [PlatformObject]
 Graphic  = PlatformGraphic Graphic  = PlatformGraphic
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 the parent object called Scene to contain all the platform objects (and later other objects too):+Start by re-using the Scene object as a parent to contain all the platform objects (and later other objects too):
  
-<code=ini>+<code=ini [highlight_lines_extra="2"]>
 [Scene] [Scene]
 ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject #TopPlatformObject #TopRightPlatformObject ChildList = PlatformObject # MiddlePlatformObject # TopLeftPlatformObject #TopPlatformObject #TopRightPlatformObject
Line 113: Line 114:
 Next change the code in the Init() function to create "Scene" instead of "PlatformObject": Next change the code in the Init() function to create "Scene" instead of "PlatformObject":
  
-<code=cpp>+<code=cpp [highlight_lines_extra="2"]> 
 +orxObject_CreateFromConfig("HeroObject");
 orxObject_CreateFromConfig("Scene"); orxObject_CreateFromConfig("Scene");
 </code> </code>
en/guides/beginners/platforms_and_texture_repeating.1550577217.txt.gz · Last modified: 2019/02/19 07:53 (6 years ago) (external edit)