• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
Game-U
  • Tutoring
  • After School
    • After School Classes
    • Workshops
    • Homeschool Circle
  • Summer Camps
  • Events
    • Game Nights
    • Game Showcases
    • Community Events
    • Birthday Parties
  • Team
  • Contact Us

Sprite Meets Coffee

December 21, 2018 | Written by: Rebecca Lilley | Leave a Comment

Accelerate Flemington, NJ

Remember Prometheus? He works with instructor Andrew as part of Game-U’s Accelerate program, and has put together games like the Project Spark Dragon Quest, or the Tarzan-style GameMaker platformer. Today in GameMaker, he created the sprite equivalent of coffee!

What human beings accomplish with coffee, sprites like Prometheus’ GameMaker character accomplish with power-ups. After fixing a few minor bugs left over from last class, Prometheus and Andrew focused on creating a speed power-up for the player sprite to collect. Sprite, meet coffee! Prometheus wanted the power-up to temporarily increase the player’s speed. Here’s how he made it happen.

First, Prometheus selected an object for his player sprite to collect. He then selected another sprite (a series of character-based images that play in quick succession) to give the object form and motion. Using the collection trigger, Prometheus coded a global boolean variable to signal other code that power-up rules are now in force. The boolean, which is valued at either true or false, acts like a flag to the rest of the program. If it’s false, the program operates on non-power-up conditions. If it’s true, the program switches to operate according to power-up rules. Since the power-up boosts the player’s speed, any part of the program related to speed must pay attention to the flag’s value. Like a row of dominoes, the true value causes a cascade effect – changing the speed variable from “basespeed” (the default speed of the player) to “speedboost” (the player’s speed on digital coffee). Since Prometheus also added a Special Points meter to limit the use of power-ups, a true value also triggers a decrease in the meter value (watch the bar in the top left corner of the video). A false value, on the other hand, preserves the ordinary state of operations. Once the player sprite collects the virtual coffee, the boolean variable is set to true and the player gets all the benefits of speed boost conditions!

Cool stuff, Prometheus. You’ve got a great handle on the logic that goes into coding games. Keep sharing your progress, especially on that unfinished SP meter. We look forward to playing your platformer for ourselves!

Related

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
Tags: Accelerate, Accelerate Highlights, code, Game Design, GameMaker, Project Spark

Reader Interactions

Leave a Reply Cancel reply

sidebar

Most Used Tags

  • 3D Modeling
  • code
  • Group Events
  • art
  • Game Design
  • Robotics
  • Animation
  • Unity
  • TinkerCAD
  • Blender
  • Game Development
  • Group Highlights
  • Unreal
  • Group Student of the Month
  • Events
  • coding
  • Accelerate
  • Maya
  • Accelerate Highlights
  • Project Spark
Back to Top

Ready to get in the game?

Enter your email and ZIP Code to learn more about Game-U and how to get started.

Game-U
Company
  • About
  • Programs
  • Locations
  • Events
  • Blog
  • Careers
Resources
  • Contact
  • Achievements
  • Parent Portal
Information
  • Privacy Policy

Call Us contact@game-u.com
  • Facebook
  • Twitter
  • Instagram
  • Youtube

Copyright ©2021 Game-U