Dylan  Iqbal

Dylan Iqbal


Build a Space Game: Scoring and Lives

In this lesson, you'll learn how to add scoring to a game and calculate lives.

Draw text on the screen

To be able to display a game score on the screen, you'll need to know how to place text on the screen. The answer is using the fillText() method on the canvas object. You can also control other aspects like what font to use, the color of the text and even its alignment (left, right, center). Below is some code drawing some text on the screen.

ctx.font = "30px Arial";
ctx.fillStyle = "red";
ctx.textAlign = "right";
ctx.fillText("show this on the screen", 0, 0);

Life, as a game concept

The concept of having a life in a game is only a number. In the context of a space game it's common to assign a set of lives that get deducted one by one when your ship takes damage. It's nice if you can show a graphical representation of this like miniships or hearts instead of a number.

What to build

Let's add the following to your game:

  • Game score: For every enemy ship that is destroyed, the hero should be awarded some points, we suggest a 100 points per ship. The game score should be shown in the bottom left.
  • Life: Your ship has three lives. You lose a life every time an enemy ship collides with you. A life score should be displayed at the bottom right and be made out of the following graphic
life image

Recommended steps

Locate the files that have been created for you in the your-work sub folder. It should contain the following:

-| assets
  -| enemyShip.png
  -| player.png
  -| laserRed.png
-| index.html
-| app.js
-| package.json

You start your project the your_work folder by typing:

cd your-work
npm start

The above will start a HTTP Server on address http://localhost:5000. Open up a browser and input that address, right now it should render the hero and all the enemies, and as you hit your left and right arrows, the hero moves and can shoot down enemies.

Add code

Copy over the needed assets from the solution/assets/ folder into your-work folder; you will add a life.png asset. Add the lifeImg to the window.onload function:

lifeImg = await loadTexture("assets/life.png");

Add the lifeImg to the list of assets:

let heroImg,
eventEmitter = new EventEmitter();

Add variables. Add code that represents your total score (0) and lives left (3), display these scores on a screen.

Extend updateGameObjects() function. Extend the updateGameObjects() function to handle enemy collisions:

enemies.forEach(enemy => {
    const heroRect = hero.rectFromGameObject();
    if (intersectRect(heroRect, enemy.rectFromGameObject())) {
      eventEmitter.emit(Messages.COLLISION_ENEMY_HERO, { enemy });

Add life and points.

Initialize variables. Under this.cooldown = 0 in the Hero class, set life and points:

this.life = 3;
this.points = 0;

Draw variables on screen. Draw these values to screen:

function drawLife() {
  // TODO, 35, 27
  const START_POS = canvas.width - 180;
  for(let i=0; i < hero.life; i++ ) {
      START_POS + (45 * (i+1) ), 
      canvas.height - 37);

function drawPoints() {
  ctx.font = "30px Arial";
  ctx.fillStyle = "red";
  ctx.textAlign = "left";
  drawText("Points: " + hero.points, 10, canvas.height-20);

function drawText(message, x, y) {
  ctx.fillText(message, x, y);

Add methods to Game loop. Make sure you add these functions to your window.onload function under updateGameObjects():


Implement game rules. Implement the following game rules:

For every hero and enemy collision, deduct a life.

Extend the Hero class to do this deduction:

decrementLife() {
  if (this.life === 0) {
    this.dead = true;

For every laser that hits an enemy, increase game score with a 100 points.

Extend the Hero class to do this increment:

  incrementPoints() {
    this.points += 100;

Add these functions to your Collision Event Emitters:

eventEmitter.on(Messages.COLLISION_ENEMY_LASER, (_, { first, second }) => {
   first.dead = true;
   second.dead = true;

eventEmitter.on(Messages.COLLISION_ENEMY_HERO, (_, { enemy }) => {
   enemy.dead = true;

Do a little research to discover other games that are created using JavaScript/Canvas. What are their common traits?

By the end of this work, you should see the small 'life' ships at the bottom right, points at the bottom left, and you should see your life count decrement as you collide with enemies and your points increment when you shoot enemies. Well done! Your game is almost complete.


Your code is almost complete. Can you envision your next steps?

Post-Lecture Quiz

Post-lecture quiz

Review & Self Study

Research some ways that you can increment and decrement game scores and lives. There are some interesting game engines like PlayFab. How could using one of these would enhance your game?


Build a Scoring Game

Originally published at https://github.com/microsoft/Web-Dev-For-Beginners/blob/main/6-space-game/5-keeping-score/README.md 

#gamedev #javascript #html 



What is GEEK

Buddha Community

Build a Space Game: Scoring and Lives
Tamale  Moses

Tamale Moses


Playground Games and Turn 10 Studios respectively improved time on Visual Studio 2019

The C++ team at Visual Studio has delivered substantial build and link time improvements throughout Visual Studio 2019. This blog is Part 2 of a series of blogs showcasing real-world results of our efforts. See how the Gears 5 team benefited from iteration build time improvements in Part 1.

#c++ #performance #build throughput #build time #compile time #game development #games #gaming #iteration time #linker #video games

Autumn  Blick

Autumn Blick


Game Development with .NET

We’ve launched a new Game Development with .NET section on our site. It’s designed for current .NET developers to explore all the choices available to them when developing games. It’s also designed for new developers trying to learn how to use .NET by making games. We’ve also launched a new game development Learn portal for .NET filled with tutorials, videos, and documentation provided by Microsoft and others in the .NET game development community. Finally, we launched a step-by-step Unity get-started tutorial that will get you started with Unity and writing C## scripts for it in no time. We are excited to show you what .NET has to offer to you when making games. .NET is also part of Microsoft Game Stack, a comprehensive suite of tools and services just for game development.

A picture of a game controller

.NET for game developers

.NET is cross-platform. With .NET you can target over 25+ different platforms with a single code base. You can make games for, but not limited to, Windows, macOS, Linux, Android, iOS, Xbox, PlayStation, Nintendo, and mixed reality devices.

C## is the most popular programming language in game development. The wider .NET community is also big. There is no lack of expertise and support you can find from individuals and user groups, locally or online.

.NET does not just cover building your game. You can also use it to build your game’s website with ASP.NET, your mobile app using Xamarin, and even do remote rendering with Microsoft Azure. Your skills will transfer across the entire game development pipeline.

logos of some gaming platforms supported by .NET

Available game engines

The first step to developing games in .NET is to choose a game engine. You can think of engines as the frameworks and tools you use for developing your game. There are many game engines that use .NET and they differ widely. Some of the engines are commercial and some are completely royalty free and open source. I am excited to see some of them planning to adopt .NET 5 soon. Just choose the engine that better works for you and your game. Would you like to read a blog post to help you learn about .NET game engines, and which one would be best for you?

#.net #.net core #azure #c# #game development #azure #cryengine #game developers #game development #game development with .net #game engines #games #monogame #playfab #stride #unity #visual studio #waveengine

Sival Alethea

Sival Alethea


Learn Python by Building Five Games - Full Course. DO NOT MISS!!!

Learn Python in this full tutorial course for beginners. This course takes a project-based approach. We have collected five great Python game tutorials together so you can learn Python while building five games. If you learn best by doing, this is the course for you.
⭐️ Course Contents ⭐️
⌨️ (0:01:18) Pong
⌨️ (0:45:36) Snake
⌨️ (1:34:57) Connect Four
⌨️ (2:42:36) Tetris
⌨️ (4:22:12) Online Multiplayer Game
📺 The video in this post was made by freeCodeCamp.org
The origin of the article: https://www.youtube.com/watch?v=XGf2GcyHPhc&list=PLWKjhJtqVAbnqBxcdjVGgT3uVR10bzTEB&index=4
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!

#python #games #learn python by building five game #project-based approach #game in python #learn python by building five games - full course

Alex  Sam

Alex Sam


Top Chat Software for Live Streaming & Broadcasting Web & Mobile Apps

Do you Increase your Website Engagment? 

I analysed, ranked and reviewed best live video streaming chat APIs and SDKs for your web & mobile app based on client reviews and ratings. portfolio, usecases, cost, secure streaming, live chat features, cost, support, etc.

Turn your viewers into participatients with Live Streaming Chat Solutions. There are lot of Real-time chat apis & SDks Providers have in online market now. You can easily integrte and customize real time chat solutions into your new or existing live video streaming web and iOS & android applications. Below have mentioned best real time chat api & SDk Proivders.

Live video streaming chat api
Live video streaming chat apis

Here are The Most Popular Live Video Streaming Chat APIs & SDKs to be Considered for your Mobile App

1. CONTUS Fly - Real-time Messaging Platform for Live Streaming Apps & Webs

CONTUS Fly is one of the leading real time messaging software providers in the market for a decade. Their messaging platforms are completely customizable since they provide Chat APIs and SDKs to integrate real time chat feasibility on your live streaming applications irrespective of audience base. Engage your audience like a live concert, stadium like experience through digitally. Create channels for every live streaming event, sports or anything that would create buzz. Enable audience to interact with each other over voice, video chats and real-time text chats with engaging emojis. CONTUS Fly enables users to add emojis and stickers to captivate each audience and create fun.

Highlight Features of CONTUS Fly Live Video Streaming Platform Includes:

  1. Chat for Live Video Streaming
  2. Video & Audio Recording
  3. Video Calling
  4. Drawing whitebord
  5. Screen Sharing
  6. End to End Encryption

2. Apphitect -Instant chat for Live Streaming Platforms

To make every live streaming and broadcasting videos more engaging and entertaining, Apphitect’s instant messaging comes with exciting Instant messaging chat APIs to add chat into streaming applications. Apphitect is built with multiple real time communication features like video chat, voice chat and real-time chat to your streaming apps. Their solution surprisingly has a wide range of features to communicate, engage and increase subscription benefits.

Highlight Features of Apphitect Live Insterative Broadcasting Software Includes:

  1. Live Video Streaming Chat
  2. Cross Platform Support
  3. Audio & Video Recording
  4. Live Video Calling
  5. Emoji & Stickers

3. MirrorFly - Enterprise Real Time Chat for Streaming Websites

One of the enterprise-grade real-time chat solutions built to create virtual chat experience for live streaming events and websites for big brands and startups. Irrespective of audience base, category, MirrorFly provides customizable real time chat APIs to add virtual communication mediums on live streaming and broadcasting applications. Their solution comes with absolute moderation tools and open channels to talk and listen with your audience. MirrorFly’s server infrastructure has the potential to handle concurrent messages and users and to achieve maximum sales conversion.

Highlight Features of MirrorFly Live Streaming Chat API Includes:

  1. Face to Face Video Calling
  2. Live Interactive Broadcasting
  3. Call Recording
  4. Digital Whiteboard
  5. Group Video Calling

4. Applozic - Real-time Chat Plugin for Live Broadcasting & Video Streaming apps

When it comes to building a live streaming chat app software that covers the entire platforms and demand All-in-One package (features, Customization to any extent) with a one-time payment for lifetime performance, then undoubtedly Contus Fly makes the right choice to partner with. The company offers live broadcasting SDK for Android/iOS and chat APIs for customization.

Highlight Features of Applozic Chat Live Streaming Platform Includes:

  1. Real time Communication
  2. Cross Platform Support
  3. Live Audio Broadcasting
  4. Push Notifications
  5. Secure Image Sharing

5. Sendbird - Top Real time Chat for Live Video Streams

Being a leading real time chat platform provider in the market, Sendbird has its own hallmark of communication features to the world’s most prominent live streaming applications. Their real time chat solution enables broadcasting and streaming platform’ owners to create a physical equivalent digital chat experience for the audience during any live event streaming to interact, collaborate and cheer together within the same streaming screen. By creating open channels and groups, you can enable the audience to interact with each other during any streaming, engage them with polls, stickers, multiple communication channels and more.

Highlight Features of Sendbird Live Streaming Chat API Includes:

  1. Chat for Streaming website
  2. Messaging Data
  3. Multi Platforms
  4. Push Notifications
  5. End to End Encryption

6. Agora - Interactive Live Chat for Live Video Streaming

Agora, a deep integratable API available in the market to deliver live interactive streaming experience for workplace, enterprises, gaming, retail, telehealth and social live streaming websites. With easy-to-embed SDKs, Agora empowers businesses to add HD and low latency video and voice chat features into any streaming platforms and channels. Their easy-to-embed real time chat features encourage higher levels of user engagement and opportunity to drive more audience.

7. Enablex - A Redefined Communication APIs for In-app Chat

Their smart and secure chat APIs deliver real-time chat feasibility for live and on-demand video streaming websites. The real time chat features provides users to communicate and engage within the same streaming platform irrespective of interaction medium and audience count. Enablex offers platform-as-a-service communication solutions for real time messaging integration with APIs hosting possibility on public, private and cloud deployment. Their APIs are enriched with multiple communication features and engagement tools like live-polls, stickers and more.

8. Pubnub - In-app Chat Platforms for Live Event Streaming Websites

In order to increase user engagement with live and remote audiences, Pubnub offers real time messaging chat functionality with interactive features to drive event-based engagement with mass chat. Their in-app chat feature enhances live programs, event streaming and blogging content with live polling, multiple chats and more. It also enables live streaming websites to build community, channels and super groups during live streaming to bring the entire audience base to one place.

9. Vonage - Communication APIs for In-app Messagings

Vonage is a prime provider of communication APIs for major industrial sectors and enterprise workplaces. With its API, businesses such as live streaming applications can integrate in-app messaging features into any streaming platforms on Android, iOS and Web to empower user engagement. Their APIs are powered with scalable infrastructure and provide multiple communication mediums such as in-app voice, video and chat proactively engaging the audience.

10. Firekast - Live Chat Widget for Video Streaming Player

Firekast provides a customizable live chat widget with HTML code for streaming players to enable chat within any streaming or on-demand videos. The chat widget gives the ability for brands and content owners to make the audience to interact with each other for better engagement and proactivity during streaming. The Firekast Live chat comes with moderator tools that will allow administrators to delete or ban abusive content and users from the channel or groups. Firekast’s live chat comes with a private chat widget to create public or private chat rooms to make effective collaboration and discussions.

And this is all the real time chat providers in the market to implement chat functionality in any live streaming or broadcasting platforms. More than delivering entertaining live content, creating a massive engagement and buzz for every live event is the smarter way to turn every audience into a protiable subscriber. Picking up the right software provider is more important than just handling the integration process.

#live #live-streaming-solutions #live-streaming-chat-api #live-streaming-chat-sdk #chat-api-for-live-broadcasting

Juned Ghanchi


Mobile Game Development Company India, Game Developers in India

IndianAppDevelopers is a top-notch mobile game development company that has the ability to transform the unique requirements of clients into a flawless mobile game app. Choose us as your mobile game development partner on a fixed cost, dedicated or hourly basis at 40% less cost.

Our dedicated team of 20+ game developers has served 50+ mobile game development projects with a ratio of 100% satisfaction using the latest technologies and tools like Unity, Unreal, COCOS 2d js. Phaser etc.

Are you planning to outsource mobile game development services? Or would you like to hire a dedicated team of game developers? Then, contact us for a free quote.

#mobile game development company #game development company #hire game developers #game app developers #mobile game developers india #hire game app developers