BOMB


Bombs are ultimately the Goal of Jumpman and the purpose behind every Level. A Level is deemed complete when all the Bombs have been collected. (unless otherwise specified (see level (link) settings))

Unlike all other objects (exception being a Trigger). Bombs allow for a little Visual Basic Scriptlet to be run when the bomb is collected. This allows for you to change the Properties or call Methods of other objects in the Level.

When you create a Bomb, the following object graphic is drawn in the editor.. It can then be selected and moved around as per any other object. Shown is the non-selected and selected states of the Bomb.

There is no limit to the number of Bombs which can be created on each level but there MUST always be one. The Editor will not allow you to delete the last bomb. Doing so will bring up the following Warning Dialog (yeah. I know I'm teaching you to Suck Eggs here )..



This Section describes the object and the properties available at design time.

When a Bomb is Selected, the Property Editor Window will bring up the following dialog;


Name

Sets the name of the object which is used to reference it via the Visual Basic Scriptlets. Object Names Cannot Contain any spaces and Must be unique.

It is important to note that changing the name of an object will not change any references to it via the scriptlets. Generally it would be unlikely that you would change the name of an object from the one generated by the program.

 

Points

Defines the Number of Points to increase the current players score by. Valid numbers range from 0 to 10000. Generally you would give more points if the Bomb has been marked as a Bonus Bomb.

 

Visible

If Ticked, then the Bomb is Visible at run-time.. If the Bomb is either not Visible or Active then it is drawn in a darker shade to signify that it is different from other Bomb's.

 

Active

If Ticked, then the Bomb is Active at run time.. Active means that the player will be able to Collect It. It is possible to have an invisible Bomb which can be collected and a visible bomb which can't by different combinations of the Visible and Active flags.

 

Collect Sound

Defines the Sound to play when the Bomb is Collected. Selecting this item will bring down a list of all the Sounds available in the Sound Manger (link).

 

Sprite Image

Defines the Image set to use for rendering the Bomb at run-time. Selecting this item will bring down a list of all the Images available in the Image Manger (link). The Bomb is animated out of 16 individual Frames.. Starting at the top left, moving along the top row and then onto the second row (again Left to Right) and down onto the next row (etc..). When the Animation has finished it then repeats from the start.

 

Random Start Frame

If Ticked, then the Bomb will start Animating at a Random frame from the 16 available Bomb Frames. If Not Ticked then the Bomb will start at the beginning (frame 0). Use this is you want all the Bombs to pulse (if using the above graphic) differently from each other.

 

Animation FPS

Defines the Speed (in Frames Per Second) which the Bomb will Animate at. Valid values range from 1 to 60.

 

Bonus

If Ticked, the Bomb is classified as a Bonus Bomb.. What that means is that it plays an animation over the bomb when it is collected. This animation is played for 1500 milliseconds (1.5 seconds).

If a the Bomb is a Bonus Bomb.. An outline where the animation will play is drawn around the Bomb as pictured below;

 

Bonus Sprite Image

Defines the Image set to use for rendering the Bomb at run-time. Selecting this item will bring down a list of all the Images available in the Image Manger (link). The Bomb is animated out of 16 individual Frames.. Starting at the top left, moving along the top row and then onto the second row (again Left to Right). When the Animation has finished it then repeats from the start.

This Animation is played for 1500 milliseconds (1.5 seconds) when a Bonus Bomb is collected.

 

Scriptlet

Jumpman - Under Construction uses the Inbuilt Scripting Language in Windows called 'Visual Basic Scripting'. It's a very powerful language which is quick and allows for quiet complex programs to be written.. Jumpman-UC uses this scripting language but thankfully doesn't require the complexity's of it, making it easy to program.

Basically each Object in a Level is available to be controlled from the script. This allows either properties of the object to be changed or Methods to be called.

Every time a Bomb is Collected, The Game Engine will process the Script. The Script can off course do nothing but it can also change the state of many items within the level making things change.

The Edit box for the Scriptlet is used to enter in the Basic Script to be executed. It is a simple edit box with no special features. Any Syntax Errors entered in will not become apparent until the level is run.

These help docs are not here to explain the syntax of Visual Basic or it's full use. These can be found either on MSDN (link) or by downloading the Reference Guide from the Downloads section of this site. Either of these sources provides detailed if not dry help on use of the language.. aswell as a lot of features not required by Jumpman-UC.

On the whole you will only need to turn things On and Off or Play the odd sound effect so the scripting will be extremely easy to pick up. The Best way to learn is to go though each level and see what the scriptlets actually do.. There is nothing overly complex in any of the Levels.. I recommend Looking at Grand Puzzle I and Vampire as good starting levels.

Your Basic Script command is made up of 3 parts (for changing a property of an object)

<Object Name>.<Property Name> = <Value>

Object Name Each object is given a Name (the .Name property). This is used to reference that particular object.
Property Name Each object type has a number of properties which are accessible to the script. These are defined in these help documents under the relevant object.
Value Each property is of a certain type. (either Number, Boolean, String etc..). The Value must be of the same type as what the Property expects.

Example, If you have Bomb named Bomb1 then,

Bomb1.Active = True

Will set the Active property to True.

 

A Method is made up of 2 parts

<Object Name>.<Method Name>

Object Name Each object is given a Name (the .Name property). This is used to reference that particular object.
Method Name Each object type may have a number of Methods which can be called.. A Method is basically a function of the object that can do much more complex operations than just change a few properties. Please refer to the object type for a list of the methods supported by that object (if any).

Example, If you have Fire named Fire1 then,

Fire1.PutOutAllFires

Would call the PutOutAllFires Method for that object. (refer to Fire (link) to see what that actually does)

 

Visual Basic Scripting can also do conditional statements as this scriptlet from Grand Puzzle I shows;

If (Player1.HoldingLadder = True) then

' play sound effect
PlaySound "LadderIncrease"
' not holding a ladder any more
Player1.HoldingLadder = False
' make the ladder segment (under trigger) real
Ladder8.Visible = True
Ladder8.Active = True
' disable this trigger
Trigger1.Active = False
' make the next one (above) active
Trigger2.Active = True

End If

Jumpman does provide some semi-helpful error dialogs on script errors. Unfortunately VBS doesn't exactly write a novel about script errors so some errors may be a little vague.. It is best when developing a level to make little changes and test the result before going onto the next change. Any Script errors will bring up one of the following dialogs. After pressing Ok, The Game will continue as per normal.

Generic Syntax Error

Script Example;

Bomb1.Active = True  
Syntax Error ' will generate a syntax error
Bomb2.Visible = True  

 

Invalid Object (Reference) Error (Object Doesn't Exist)

Script Example;

Bomb99.Active = True ' Non existent object in level

 

Invalid Property or Method Name Error

Script Example;

Bomb1.Enabled = True ' Invalid Property Name

 

Compiler Gets Totally Lost Error

This error unlike the others cannot be tracked down to the object or a specific line. If you get it, it will be just as the Level Starts but before anything has rendered. It is generally given when the syntax of the script has caused the compiler to give up the compilation process.

The following script example will bring up the error.. If you do get it, It is best to check what you have recently done to check for any obvious errors.

Bomb1 = Syntax Error ' Confuse the VBS Compiler


This Section describes the object and how it can accessed and controlled via the scriptlets at run-time.

A Method is a function call which can be executed whilst a Property changes the state of a individual flag in the object.

 

There are currently no script accessible Methods for Bomb's.

 

.Visible

Makes the Bomb Visible or Not.. Irrelevant if a Bomb is Visible or Not, It must be Active for Jumpman to be able to Collect it. Valid Values are True and False.

Script Example..

Bomb1.Visible = True

The Object will either Fade In or Fade Out depending on the state of .Visible

 

.Active

Makes a Bomb Active or Not.. An Active Bomb can be Collected by the Player. Valid Values are True and False.

Script Example..

Bomb1.Active = True

Ideally both the .Visible and .Active properties should be changes at once to the same state unless you want some confusing level behavior. (Which may be the case)

ie..

Bomb1.Visible = True
Bomb1.Active = True