13 - Optimize the frequency of obstacles

fifteen Unauthorized reproduction is prohibited Understanding the course
Course Introduction
discuss {{interaction.discussNum ? '(' + interaction.discussNum + ')' : ''}}
Suitable for people
After learning grammar, I want to be a project trainer, which is very suitable
You will learn
Project driven knowledge points, grow in real combat, bid farewell to black and white interface development, and learn a new image interface! Real zero base practical introduction!
Course Introduction

The following is a game development project using C language: Daily Cool Run

Expected 800 lines of code


This course will teach students how to use C language and some C++functions to develop a 2D game called "Daily Cool Run".

This course is suitable for beginners who are interested in game development and have some experience (they can do it after learning C language grammar).


In this lesson, you will learn how to use basic concepts such as constants, variables, arrays, loops, and functions to complete the core functions of the game. We will provide sample code suitable for various development environments such as VC2010-VS2022, and you can quickly master these knowledge points through 7 hours of practice.


By taking this course, you will gain the following skills:


1. Design of game engine architecture;

2. Implementation of core functions of the game, including collision detection;

3. Cool score design and implementation method;

4. Quickly improve project development capability.


The specific course details are as follows:


1. Multi layered rolling background to achieve a sense of three-dimensional distance;

2. Design of the game engine architecture, including initializing and closing the game, and the main cycle of the game;

3. Design and implementation of multiple obstacles, including random generation and moving effects;

4. Implementation of core functions of the game, including collision detection, jumping and squatting;

5. Design and implementation methods of cool scores, including calculating scores and displaying scores;

6. Quickly improve project development ability, including code optimization and debugging skills.


This course will provide you with comprehensive guidance to help you quickly master the basic skills of C language game development.

During the learning process, you will not only have the opportunity to create a wonderful game, but also learn many useful programming skills and knowledge points.





common problem
Q: Need English for C language introduction?
Answer: No, you can learn 26 letters!
Expand more
release
 head portrait

{{ item.user.nick_name }} {{ EROLE_NAME[item.user.identity] }}

Topping note
 Discussion Chart
{{ item.create_time }} reply
  • delete

    Are you sure to delete?

    confirm
    cancel
  • {{item. is_top==1? 'Cancel topping': 'topping'}}

    The discussion that has been set to the top, do you want to replace the existing one?

    confirm
    cancel
{{ tag.text}}
 head portrait
{{ subitem.user.nick_name }} {{ EROLE_NAME[subitem.user.identity] }}
{{ subitem.create_time }} reply
delete

Are you sure to delete?

confirm
cancel
release
{{pageType==='video '?' The discussion area grabs the sofa, and you can get double credits': 'The discussion area is empty, please say two sentences~'}}
release
{{tips.text}}
{{ noteHeaderTitle }} note {{hasMyNote? 'My notes':' Take notes'}}
{{hasMyNote? 'My notes':' Take notes'}}
Quality Notes
Updated on: {{$dayjs. format ('YYYY-MM-DD HH: mm: ss', item.last_uptime*1000) }}
 head portrait
{{ detail.username }}

Public notes are visible to others and have the opportunity to be rated as "high-quality notes" by the administrator

{{ noteEditor.content.length }}/2000

Public Notes
preservation
put questions to

The lecturer will answer your questions as soon as possible. If you choose to ask questions in public, you can get more help from students.

Record time point
Record the time when the video is played when asking questions, so as to facilitate subsequent viewing
Open questions
Submit
localStorage.setItem('cto_video_pageLoad', new Date().getTime()); ! function(f,p){"use strict"; var h=new RegExp("\\.css"),y=p.head||p.getElementsByTagName("head")[0],r=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/? (\d+).*/i,"$1")<536; function s(e){return"complete"===e.readyState||"loaded"===e.readyState}function b(e,t,n){var o="onload"in e; function a(){e.onload=e.onreadystatechange=null,e=null,t()}"css"!== n||!r&&o?o? (e.onload=a,e.onerror=function(){e.onerror=null,f._cdnFallback(e)}):e.onreadystatechange=function(){s(e)&&a()}:setTimeout(function(){!function e(t,n){var o; t.sheet&&(o=! 0),setTimeout(function(){o?n():e(t,n)},20)}(e,t)},1)}function u(t,n,e,o){if(t)if(h.test(t)){var a=t,r=e,c=u,i=p.createElement("link"); if(r.attrs)for(var l in r.attrs)i.setAttribute(l,r.attrs[l]); r.prefetch? (i.href=a,i.rel="prefetch",c&&c()):(i.rel="stylesheet",b(i,c,"css"),i.href=a),y.appendChild(i)}else{var c=t,d=e,a=u,f=d.prefetch?p.createElement("link"):p.createElement("script"); if(d.attrs)for(var s in d.attrs)f.setAttribute(s,d.attrs[s]); d.prefetch? (f.href=c,f.rel="prefetch",a&&a()):(f.charset="utf-8",b(f,a,"js"),f.async=!1,f.src=c),y.appendChild(f)}else setTimeout(function(){u()}); function u(){var e=n.indexOf(t);-1 r&&e.left