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 [2018/06/27 06:14 (7 years ago)] 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 91: Line 92:
 <code=ini> <code=ini>
 [MiddlePlatformObject@PlatformObject] [MiddlePlatformObject@PlatformObject]
-Position = (250450, 0) +Position = (-150150, 0) 
-Scale = (30, 2, 0) +Scale    = (30, 2, 0) 
-Repeat = (15, 1, 0)+Repeat   = (15, 1, 0)
  
 [TopLeftPlatformObject@PlatformObject] [TopLeftPlatformObject@PlatformObject]
-Position = (0320, 0) +Position = (-40020, 0) 
-Scale = (14, 2, 0) +Scale    = (14, 2, 0) 
-Repeat = (7, 1, 0)+Repeat   = (7, 1, 0)
  
 [TopPlatformObject@TopLeftPlatformObject] [TopPlatformObject@TopLeftPlatformObject]
-Position = (300200, 0)+Position = (-100-100, 0)
  
 [TopRightPlatformObject@TopLeftPlatformObject] [TopRightPlatformObject@TopLeftPlatformObject]
-Position = (60090, 0)+Position = (200-210, 0)
 </code> </code>
  
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.1530105288.txt.gz · Last modified: 2018/06/27 09:14 (7 years ago) (external edit)