My first experience of Go+ language - how fast is GO+ writing games? It only takes 5 hours to write a game from zero basis

Let me explain first, it is not a title party. If you are interested, please read the
specific code and see the warehouse: https://github.com/uiuing/spx

First look at the effect
This GIF 43 seconds
insert image description here
GitHub repository: https://github.com/uiuing/spx



origin

I got up this morning to brush the GO+ community and saw an article by the big guy: https://bbs.csdn.net/topics/603582959
insert image description here

Then I became interested in an instant, and then made up the official video: https://bbs.csdn.net/topics/603487787
insert image description here



learning process

My understanding is still a bit vague, so I won't discuss the technical content here . I don't care about
it, so I went directly to the warehouse to pull a running demo: https://github.com/goplus/spx , follow Xu Da's tutorial step by step
insert image description here

Then cloned to the local, with the tutorial of the warehouse
insert image description here

tutorialCombine it and read the cases in it slowly ,
insert image description here
then tutorialrun through the cases in it, continue to deepen the understanding,
and testthen run the cases in it again.
insert image description here
Although there is no spx code highlighting, it is still very comfortable to understand. After all, GO+ is very suitable for As an introductory language for teenagers to learn programming
insert image description here

hands-on

frame up

Now that the code has been read once, if you want to deepen your understanding, you have to implement it yourself.
Refer to the case in the warehouse 05-Animationand 04-Bulletwrite a small game about "eliminating viruses"
.
insert image description here

06-DestroyVirus

  • res : some files for settings
    • sounds : sound files
      • bgm : background music
      • hit : the sound effect of the virus being eliminated
    • sprites : some "sprites"
      • MyMedicine : Needle
      • Virus : virus
    • backdrop.png : background image
    • index.json : global settings
  • index.gmx : global configuration
  • MyMedicine.spx : Needle configuration
  • Virus.spx : Virus configuration

Please note that I am not a professional game developer, so the game configuration here is only a rough understanding.
For example , sprites : Sprites are concepts from game development, although sprites are not a multi-sound translation, but the de facto standard Or the tradition already exists.

If there are any mistakes, please correct me!


res

Directory Structure

insert image description here

sounds

insert image description here

Make a picture

make background
insert image description here

其他的配图
Blue virus ICON:https://www.iconfont.cn/user/detail?spm=a313x.7781069.0.d214f71f6&uid=207078
Needle ICON : https://www.iconfont.cn/user/detail?spm=a313x.7781069.0.d214f71f6&uid=4176001

Create a shattering effect
insert image description here

sprite

MyMedicine

Configure the needle map first
insert image description here

Virus

The next step is to configure the virus, in addition to the basic style, you also need to add the broken effect after clicking
insert image description here

res global configuration

The background is mainly configured here, the above modules are imported, and a timing effect is added
insert image description here


index.gmx

These modules are mainly imported here, including 针管, 病毒, sound effects, and background music
. Three variables are used for: timing, virus generation time, and virus falling speed.
insert image description here


MyMedicine.spx

onStartLet the MyMedicinesticker find the mouse position and play background music
insert image description here


Virus.spx

Here, let 病毒it be automatically generated at intervals, and set a random drop position. In addition, it has also added the condition of automatically randomizing the above whenever the time increases by 10 seconds.
Of course, if it is clicked 病毒, 病毒it will disappear.
insert image description here



Summarize

Although there are still many regrets in this attempt, for example, it has not been realized: failure, pause and other effects, but I am still very satisfied. This time I feel the ease of learning of GO+ spx. It takes about five hours from learning to production.

Guess you like

Origin blog.csdn.net/qq_41103843/article/details/121731384