Join Lee Brimelow for an in-depth discussion in this video Creating the Bullet class, part of Building Flash Games with Starling.
So now that we have our hero created, the next thing we are going to want to do…with it is to be able to fire bullets.…So the first thing we have to do is to create a Bullet class, and again, we are…going to do it in our objects package, so I'm going to create a new ActionScript…Class. It's going to be called Bullet.…And again, the Superclass is going to be starling.display.Sprite.…So this one is going to be pretty simple, all we need to do is to get that…texture out of our Texture Atlas and feed it to an image object.…So we are going to say var img, it's going to be of type image, it's equal to…new Image, and let's reach out and grab that texture so it's in the Assets class…to our ta, which is our Texture Atlas, call the getTexture method and pass in…the string name for the texture which is bullet.…
And let's set its pivotX and pivotY properties.…So we want to do pivotX = img.width * 0.5, and set pivotY = img.height * 0.5,…and then lastly we will add this image to this play list.…
So now the Bullet class itself is not going to have an update method, and the…
Author
Released
7/5/2012Starting with installation and configuration of Starling and creation of a Flash Builder project, the course shows how to prepare and import graphical assets, create MovieClip classes from sprite sheets, manage various gaming objects, detect collisions, and add both particle and sound effects. The finished game can be deployed to any browser or mobile device that integrates Flash Player 11, which was released in September 2011.
- Downloading and installing Starling and Flash Builder
- Creating the project
- Creating the main game class, static assets class, and other classes
- Building the state machine
- Creating a static assets class
- Adding images
- Creating sprite sheets with Texture Packer
- Creating and importing bitmap fonts
- Detecting collisions
- Adding particle effects
- Adding sound effects
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome41s
-
-
1. Getting Started
-
Installing Flash Builder1m 44s
-
Installing additional tools1m 30s
-
2. Project Setup
-
Creating the main game class4m 13s
-
3. The Game State Machine
-
Building the state machine7m 48s
-
4. Preparing and Importing Assets
-
5. The Menu State
-
Adding the logo2m 58s
-
Adding the play button3m 4s
-
6. The Play State
-
Adding the background1m 3s
-
Creating the Hero class6m 14s
-
Creating the Bullet class1m 44s
-
Using the StarlingPool class9m 24s
-
-
7. The GameOver State
-
Adding the background1m 10s
-
-
8. Adding Particle Effects
-
Adding the smoke texture5m 3s
-
9. Finishing Touches
-
Adding the sound effects3m 42s
-
Creating the Score class4m 18s
-
Conclusion
-
Helpful Starling resources1m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Creating the Bullet class