Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 How difficult it is to create a game like this?

views
     
Tullamarine
post Mar 27 2023, 12:33 AM

Getting Started
**
Validating
163 posts

Joined: Apr 2020
Is it a must a simple game like space invader to use timer?

Can I use indefinite loop, and then call subroutine to draw, to detect collision, to check key in every cycle / loop?

It might be slow if without timer, to handle manually, but I haven't put them into practice. Still not decisive whether to create space invader first, or continue studying disassembler project....

Thank you @narf03 and @iammyself for sharing your experience, and thanks @flashang for the links (The Galaxy shooter is not mobile friendly :=).
Tullamarine
post Apr 18 2023, 06:20 PM

Getting Started
**
Validating
163 posts

Joined: Apr 2020
My new question: How to draw a diagonal line using draw pixel function?

Unlike drawing horizontal line and vertical line, I can increment the x and y. But for diagonal line that connect corner to corner in a rectangle, how to know when to adjust x and y simultaneously? I think it requires math calculation.
Tullamarine
post Apr 20 2023, 03:33 PM

Getting Started
**
Validating
163 posts

Joined: Apr 2020
QUOTE(flashang @ Apr 18 2023, 11:33 PM)
You may look for the famous "Bresenham’s Line Generation Algorithm" :

Bresenham’s Line Generation Algorithm - GeeksforGeeks
https://www.geeksforgeeks.org/bresenhams-li...tion-algorithm/

smile.gif
*
Thank you (and @angch), for telling me about the Bresenham's Line Algorithm.

Your geeksforgeeks website requires an account to continue, so I use the example code in Wikipedia.

If I use plotLine, I can only draw horizontal line and diagonal line from upper left to lower right.
This is my own code with example screenshot.
user posted image

However, a fellow coder revealed to me plotLine is only half of the algorithm, have to use plotLineLow and plotLineHigh to meet all cases, like vertical line and diagonal line from lower left to upper right.

I am glad to learn about this. Thanks!

P/S: Attached is example source code and DOS EXE to test the limited use of plotLine function.

This post has been edited by Tullamarine: Apr 20 2023, 03:36 PM
Tullamarine
post May 2 2023, 11:37 PM

Getting Started
**
Validating
163 posts

Joined: Apr 2020
QUOTE(kitsunegeisha @ Apr 20 2023, 03:36 PM)
using html also can...i done 1 game like space impact using html
*
I think you mean JavaScript....

QUOTE(donald88 @ Apr 20 2023, 03:41 PM)
can try ChatGPT.
» Click to show Spoiler - click again to hide... «

*
Nice, wholesome video, he is a game director at Blizzard Entertainment.

This post has been edited by Tullamarine: May 6 2023, 11:27 PM

 

Change to:
| Lo-Fi Version
0.0140sec    0.35    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 02:22 AM