New Features in Build 1.0.6 of the Fantastic Worlds iOS Starter Kit

I originally thought this would be a rather “light” update to the Fantastic Worlds iOS Starter kit, but looking at my list of new properties added in the last couple weeks, I guess thats not the case. The more notable new features include: a friction setting for objects (how slippery something is), within-radius detection for objects to fire at the character, new collision body types and a collision body offset, random lines of text (great for character interactions with objects), screen panning between portals, footstep and jump sounds, and the option to add a death animation and sound to the character. Also on the art-front, I’ve waxed and polished the side-scroller/top-down starter kit a tad more with some better graphics. As always, past buyers have been emailed an update to the kit.

IMG_0159

 

For Levels 

  • Friction – this will override the friction settings in the constants.h file for all polyline-based bodies.
  • PanTimeBetweenPortals – the number of seconds the world will take to pan between portals when jumping around within the same level, excluding this property provides 0 pan time. Try this out, its a nice property!

 

For Objects

  • WillBreakWithCollectibleKeyName – You can have an object break with a  specific number of collectibles in inventory. The value for this property will be the collectible key name required.
  • AmountOfCollectibleRequired – If you set the previous property, you can also use this companion property to set the number of that collectible required. If excluded, this will default to 1. So for example, if you are only requiring 1 key to open a chest, you could exclude this.
  • DeductCollectibleAfterBreak – A YES or NO value to deduct the item from inventory used to open the object. If for example, four keys were required to open an object, then four would be deducted.
  • LeaveInSceneAfterBreak – A YES or NO variable to leave the object in the scene after it breaks. This will destroy the physics body so the character can walk past the object.
  • LeaveInSceneAfterBreakWithBody – – A YES or NO variable to leave the object in the scene after it breaks with the physics body intact.
  • Friction – this will override the friction settings in the constants.h file for objects. 0 is very slippery. Any number higher gets far less slippery, very fast.
  • FacesCharacter – A value of YES will make the object face toward character by flipping the x scale. This assumes your artwork faces to the right. If that’s not the case, the exclude this property and use the next one.
  • FacesAwayFromCharacter –  A value of YES will make the object face away from the character by flipping the x scale. This assumes your artwork faces to the right.
  • UseRadiusForFiring – A YES or NO value to use a radius (circle) to check if the object is within range before firing a weapon. By default this is set to 200, if you exclude the next property.
  • RadiusDistanceToScan – A number for the radius to scan when using the previous property.
  • CollisionBodyType – This property previously only had two options, circle and square. You can now use circle, square, wide_square, or tall_square. The last two options will either create a thin wide square or thin tall square as the collision body. You can offset where this square appears using the next property. This is useful if you want to create a portal door or villager that the character can interact with but “appear” to not collide with. Basically the character steps on a thin square below the object which triggers the any interactions, like pop up labels or images. In the example image (in the iBook documentation), the portal on the left has it’s CollisionBodyType set to square, whereas the portal on the right, has it set to wide_square (it is also offset from the center using the next property).
  • OffsetCollisionBody – This value in {x,y} format will offset where the collision body appears in the object, from the center. For example, in the previous image, the value was {0, -33}, so the collision body was offset nothing on the x, but down 33 on the y axis.
  • DoNotPauseWhenOutOfView – When set to YES, the object will not pause any actions, animations or movements when out of the visible area of the world. As of Build 1.0.6, objects are paused when out of view to optimize the speed of the app. You do not need to set this value to NO, because it will be by default. So why let an object play when out of view? One reason might be to keep two objects in sync that could potentially be seen one before the other by the player. For example, if two objects both had movements (like a monster seemingly floating back and forth on a platform), if the platform were “seen” by the player before the monster, this could potentially make their movement actions out of sync.

 

For Weapons

AffectedByPhysics – A YES or NO value to enable or disable physics of a weapon projectile. By default this is always YES. It will probably be rare that you want to exclude a weapon from the physics simulation but you have that option now by setting this to NO.

 

For Images acting as a control pad

LimitMovesToStartingSide – Set this to YES to only allow moving the control pad on whatever side of the screen it started at. This property only works if the MovesBasedOnTouch property is also set to YES.

 

For Characters

OffsetCollisionBody – This value in {x,y} format will offset where the collision body appears in the object, from the center.

FootStepsSound – This will be the key name in the FXSounds dictionary of the GameSounds.plist file for a looping sound to play when the leader is moving. Like all sounds, this can be random.

JumpSound – This will be the key name in the FXSounds dictionary of the GameSounds.plist file for a sound to play when jumping. Like all sounds, this can be random.

UseDeathFrames – A YES or NO value to play a death animation when a character dies.

DeathAtlasFile – The atlas file containing the death frames.

DeathFrames – An array of items with values for the frame order of the death animation. These are the names of the files in your atlas folder (only include the names of the standard definition files, not the @2x ones).

DeathTime – A decimal value for the amount of time to pass between death and restarting the scene. Even if you don’t include a death animation, you can set the DeathTime to make the scene wait a bit after death to restart (or go back to the start or game over menus).

 

For Buttons

DoesWhat can now equal Jump. This adds some finer tuned controls in conjunction with the control pad.

OffsetFromControlPad – If your button also uses the ShareYLocationWithControlPad property, you can set this value, in {x, y} format to offset where the button is relocated in relation to the control pad. For example, if the control pad moves to a y location of 300, you might want your attack button to move to 320. So you would set this value to {0, 20}.

OffsetFromControlPadPhone – Same as the previous property but for the iPhone.

 

 

For Labels

RandomLinesOfText – You can create an array containing other arrays for lines of text.  See the iBook for an example image

LeaveUpDuringContact – A YES or NO value to leave up a label as long as it is contact with the object that triggered it being shown. If this is YES, the FadeOutOverThisManySeconds property is still used to fade out the label.

 

For Tiles 

ParallaxOffset  – An offset value in {x, y} format for the amount to shift the object when the character moves (or when the world is moved essentially). You can create parallax scrolling effects on either the x or y axis (or both) using these amounts. They can be positive or negative decimal values. For subtle effects, use small decimal values.

 

For Collectibles

AlreadyEquippedImage –  an image to show if the weapon or character that the inventory item equips is already in use.

 

For Portals

If DisableCentering is set to YES in your app (its probably not), you now have two ways to manage moving from one portal to the next and changing the “world view” to account for the location change. Keep in mind, when the world is centered on the main character, this isn’t an issue, so these properties are not used when DisableCentering is NO.

Recommended Option #1 – the RoomGrid property will have a value in { x, y }  format where the numbers define the gridded location of the “room” the world-space is being moved to. So for example, a value of {0,1} moves the world nowhere on the x axis, but down 1 “room” on the y axis, (how far down is determined by the screen size height). RoomGrid only needs to be entered into the portal the character is arriving into (for example, the starting point), since obviously that portal is in the same room the world is being repositioned to.

Not-so-recommended Option #2 – The RoomOffsetX and RoomOffsetY can be entered into portals for the exit or entrance of your room (I would recommend choosing one or the other, for example add these properties only to portals you enter, or only to portals you arrive through, just not both). You can also set the RoomOffsetX and RoomOffsetY in the Levels dictionary to initially offset the world view.

The constants.h file

Most changes to the constants files you could probably care less about, but there’s a few notable ones this build. Here’s the new guys…

  • lineFriction – This sets the slipperiness of all line-based boundaries in the kit. The default is 0, which means there’s no friction, so lines are pretty slippery.  This value can be overridden on a per-level basis though. This really only comes into play if you’ll be creating lots of ramps for the character to walk up or down.  The range is 0 to 1.
  • objectFrictionThis sets the slipperiness of all objects in the kit if you don’t explicitly set the Friction yourself. The default of 1 means there’s a lot friction so the character will not slide on objects by default.  Thats a good thing.  This value can be overridden on a per-object basis though. The range is 0 to 1.
  • extraSceneDetection – This is set to 100, which gets added into the code when checking which objects are within the screen’s view. Objects (and their actions) are now paused by default when out of view (unless you set them to be otherwise) so added a little extra to the “in view testing” lets objects begin their animations or actions when they are right on the edges of the screen boundary. A default value of 100 is a good number I think.
  • timeBetweenReplayingSameSound – by default this is set to .5. If you lower this number you can replay the same sound faster. Raise it to prevent replaying the same sound. This is mostly here to minimize awkward rapid fire sounds when pressing the weapon button very quickly.

Property List Tweaks

The ResizeBorderBy property for Objects and Weapons can still be used, but I’ve renamed this to ResizeBodyBy. 

Likewise, the inappropriately long CollisionBodyCoversWhatPercent for Characters has also been renamed to ResizeBodyBy, and StopGoingUpAfterHowLong is now, simply JumpTime. The past properties still work just fine.

The ButtonImage property (for Collectibles) has been renamed to EquipImage. The previous property name still works.

Code Tweaks

The kit will run even faster than before now that objects out of view are paused by default. If this causes any issues in your app, simply use the DoNotPauseWhenOutOfView on any object you want to keep running off screen.

 

To update your kit from 1.0.5, make a back up copy of your version of the kit (as a precaution of course), and open the zip labeled Changed_Files_for_Latest_Build.

As always you will need to manually change the Build number in the Project Settings from 1.0.5 to 1.0.6

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s