Player Controller Script (RPG)
This script will control a character left right and up and down. It is meant to be used with the Player Animation script below.
playercontroller_0.z | |
File Size: | 1 kb |
File Type: | z |
Player Animation Script (RPG)
Works in conjunction with the Player Controller Script (above). This changes animation of player character to include: walking L,R,U,D and standing (idle) L,R,U,D. All animations are properties that can be easily updated and changed.
playeranimation_0.z | |
File Size: | 3 kb |
File Type: | z |
Player Controller With Keyed Rotation (Asteroids)
Uses left and right arrow keys to rotate, up arrow key to move forward with continuous and accelerating velocity.
player_controller_asteroids.txt | |
File Size: | 2 kb |
File Type: | txt |
Player Controller With Mouse Rotation (Asteroids)
Uses mouse location to rotate a player object, up arrow key to move forward with continuous velocity as above.
player_controller_asteroids_mouse_rotation.txt | |
File Size: | 3 kb |
File Type: | txt |
Asteroids Scripts (four scripts below)
The following four scripts are used with the asteroids game but can be modified to work with most top down shooters. Read the comments to see how you can implement them in your game. If you wish to use the lives component, you need to make copies of the player controller and asteroid controller scripts and name them to spawn after each lost life.
Controls for the player using mouse rotation
cp1_playercontroller.txt | |
File Size: | 3 kb |
File Type: | txt |
Script for the bullet spawner (called Cannon, you would need to change to your own name).
- Create an orientation component for your player object!
- Change Default Orientation Bases to world forward Y Up Z
- Change Global up to 0, 0, 1
cp1_cannon.txt | |
File Size: | 1 kb |
File Type: | txt |
Script applied to bullet to destroy off screen and to destroy asteroid (or enemy)
cp1_bulletcontroller.txt | |
File Size: | 2 kb |
File Type: | txt |
Controller for the enemy. no Ai, just affected by bullets and collisions with the player object.
cp1_asteroidcontroller.txt | |
File Size: | 0 kb |
File Type: | txt |
Mouse Shoot
Script shoots a projectile from player object. Allows you to keep your collider as ghost = false.
mouseshoot.txt | |
File Size: | 2 kb |
File Type: | txt |
Dodgeball
Similar to Mouse shoot but with fewer variables
dodgeball_script.txt | |
File Size: | 0 kb |
File Type: | txt |
Ball Destroyer
Destroys your projectile when it contacts your own player. This was created along with the dodgeball script above.
ball_destroyer_script.txt | |
File Size: | 0 kb |
File Type: | txt |
Health
This script applies health to the object that it is a component of. You need to add different health scripts to different game objects.
This script must be used with Damage On Collide: The apply Damage event is initialized in that script.
This script must be used with Damage On Collide: The apply Damage event is initialized in that script.
health.txt | |
File Size: | 2 kb |
File Type: | txt |
Damage On Collide
Calculates damage on collision. This script should be a component of an object that causes damage, for example a bullet. This Script should be used with the Health script above.
damageoncollide.txt | |
File Size: | 2 kb |
File Type: | txt |
Create on Death
This script will create an instance of an object when an object dies. You can apply this to an enemy and trigger an explosion or dead sprite on the screen. If you want to switch to a death screen in the event of a player dying, you will need to script a level change (check levels in tutorials)
createondeath.txt | |
File Size: | 0 kb |
File Type: | txt |
Destroy Off Screen
This script will destroy any object that falls outside the screen area. Useful for bullets and other projectiles.
destroyoffscreen.txt | |
File Size: | 0 kb |
File Type: | txt |
Timed Death
This script will destroy an object after a set amount of time.
timeddeath.txt | |
File Size: | 1 kb |
File Type: | txt |
Timed Spawner
This script will spawn objects at a set time. The time and the archetype to spawn are both properties.
timedspawner.txt | |
File Size: | 0 kb |
File Type: | txt |
Button Spawner
Spawns an object with a key press.
buttonspawner.txt | |
File Size: | 0 kb |
File Type: | txt |
Object Spawner
A more sophisticated spawner that allows you to change the number of objects to spawn and the frequency that they spawn at. You can apply velocity to the object that you spawn if it has a rigid body.
objectspawner.txt | |
File Size: | 2 kb |
File Type: | txt |
Orient Towards Velocity 2D
This script orients an object to face the direction that it is travelling.
orienttowardsvelocity2d.txt | |
File Size: | 1 kb |
File Type: | txt |
Circle Spawn
This script spawns objects around a point at an angle. If you continue to add objects, eventually they will create a circle around a point.
milans_circlespawn_for_the_library.txt | |
File Size: | 1 kb |
File Type: | txt |
Change Level on Collision
user-friendly_change_level_on__collision.txt | |
File Size: | 1 kb |
File Type: | txt |
Player Health Hud
Can be modified to display other info on screen (points, mana ammo etc.
player_health_hud.txt | |
File Size: | 0 kb |
File Type: | txt |
Enemy Spawner - timed, multiple enemy types
This spawner spawns up to 3 different enemies, can change the time delay between spawns and the rate at which specific enemies spawn. ie: basic enemy every second, secondary enemy after every 5 enemy spawns, tertiary enemy after ever 12 enemies spawned.
enemy_spawner.txt | |
File Size: | 2 kb |
File Type: | txt |