Comments (28)
@ntcho I got it, thanks.
from console-surfing-game.
@ntcho you are genious :)
from console-surfing-game.
@foba1 oh I thought it was int
type - if it seems better for you (it seems better for me), feel free to change it. π
from console-surfing-game.
@foba1, I think the hitbox problem with HitBy()
function is inevitable. But since the maximum space between other GameObject
and Player
is 1, I didn't think it would have a significant effect on the gameplay.
Also, can you elaborate a bit more on this? You can use Korean if it is hard to put it in English.
And I don't know where I should draw 3 in console.
from console-surfing-game.
I think rounding up can also solve the problem on rendering the texture. For example, I assume you start drawing with the top left coordinates given to console drawing function.
float center_x = 1.3;
float center_y = 1.7;
int width = 2;
int height = 4;
If the values are like this, you can calculate the coordinate of top left corner to define where to start drawing. Then you would call the draw()
(I don't know the exact function but anyways) like the following.
// if the function is draw(int start_x, int start_y, string texture)
draw(round(center_x - (width / 2.0)), round(center_y - (height / 2.0)), texture);
from console-surfing-game.
I think the problem can be solved with what I said above. You can get the top left coordinate first with rounded coordinates, and display it relatively to that coordinate.
If you just make that process algorithmic, then I think you wouldn't have any ambiguity in finding the exact center coordinate to render the texture.
from console-surfing-game.
@ntcho I realy understand it, very very thanks.
from console-surfing-game.
Oh yeah, player's position should seem static relative to the game frame. π
from console-surfing-game.
νλ©΄ 맨 μ νλμ€μ λ UI μ ν λΉνλκ±°λ λ κ²μνλ μ΄μ μ§μ₯μ΄ μμΌλ κ·Έκ² λμκ² κ°μΌλ©΄ κ·Έλ₯ κ·Έλ κ² ν΄λ 무방ν λ―!
from console-surfing-game.
γ γ γ γ λ€λ₯Έκ±° λ€λ§λ€μ΄μ§λ€μμ μ€ννλ©΄μ κ²°μ ν΄λ 무방ν λ―
from console-surfing-game.
I have a question, how many scenes should I draw? I guess there is 3 scenes (Ready, Play, Pause), but we might need more scenes, so I comment.
from console-surfing-game.
@foba1 You can add more scenes if you think the game needs more. I thought those three were the most essential ones, but you can add scenes like showing controls for example.
from console-surfing-game.
@ntcho When I draw object, if object's width is even number, then centerX is incorrect. It is same in height, how can I solve this problem?
from console-surfing-game.
@foba1 I thought it won't matter since all object is not on the precise integer plane, but instead they are on float
plane. It would've been nice if center_x
and center_y
was precise integer too, but then the game will be very choppy.
So instead, I thought it would be better to handle this issue in SceneManager::Render()
. For example, if the width
is an even number or center_x
is not precisely on integer point, you can just round up to nearest integer (which would be a character point in console window).
Then, rendering an object with even number of width or height would be not exactly on point, but its better than not supporting those kind of object at all.
from console-surfing-game.
@ntcho What do you think about changing type of width, height to integer? There is no way to present something whose width and height are not integer..
from console-surfing-game.
@ntcho I think more about it, and be confused. Let's assume the following.
If there is some object, centerX = 1.3 and centerY = 1.7, and width = 2 and height = 4. Then texture is '12345678' for example.
In this example, centerX = 1.3 and it is not integer, so I round it and it could be 1. And same thing is happen and centerY = 2.
There is no problem, but it could be problem in hitby() function at some GameObject. ( because of defference between 1.3 and 1 for example of centerX, in console there is spaces but could be died. )
And I don't know where I should draw 3 in colsole. ( Another thing is same. ) If width and height are even number, there is no center_texture, so there is no criteria to draw object. ( For example, width = 3,, height = 3, texture = '123456789', center_texture could be '5'. )
All of this are ocurred because when I represent something in console, I should draw it at (int, int). There is no way to draw at (1.5, 1.5). If x, y are integer, there is no problem to draw it. ( And you said the game will be very choppy, but it is same because there is no way to represent float-coordinate, so there is no defference in what we see. )
from console-surfing-game.
width = 2, height = 4, texture = '12345678' μ΄λ©΄ νλ©΄μ μλμ κ°μ΄ ννν¨.
12
34
56
78
μ¬κΈ°μ νΉμ textureμ μ’νλ₯Ό λͺ¨λ₯΄κ² λ€λ κ². μλ₯Ό λ€μ΄ centerX = 1μ΄κ³ centerY = 2μΌλ, 3μ μ’νκ° (1,2)μΈκ±΄μ§, 4μ μ’νκ° (1,2)μΈκ±΄μ§, 5 νΉμ 6μ μ’νκ° (1,2)μΈκ±΄μ§ λͺ νν ꡬλΆμ΄ μ΄λ €μ. ( width, heightκ° μ§μμ΄κΈ° λλ¬Έμ )
from console-surfing-game.
@ntcho In the game, player must exist at the center of console?
from console-surfing-game.
@foba1 Not exactly the center of the console, please check the render diagram.
Player
should be slightly behind (to the negative y-axis direction) the center of the frame. But if it seems it is not necessary to do so, just putting the user in the center of the frame is also okay.
from console-surfing-game.
@ntcho I know, just ask it should always there. Thanks.
from console-surfing-game.
@ntcho I have one question. How should I make ready, pause scene? Is there a way to change the player's texture? Just let me know what we need, even briefly.
from console-surfing-game.
For ready and pause scene, you can check the original game on edge browser. Since we are basically trying to replicate that on console, the orignal game is the reference.
from console-surfing-game.
@ntcho I mean weather we can choose the texture of the player in the game. I think it is hard to represent a lot of texture for the player, and there is no method or function about changing player's texture.
from console-surfing-game.
Oh yeah, I don't think we need different player characters. I left it out during the design process.
from console-surfing-game.
Ok. I will make to print out the game guidelines in Ready scene. Thanks.
from console-surfing-game.
I have some problem with printing UI. ( health-bar, or high-score, or etc.. ) If the coordinates are overlapped between UI and object, one of the two is not properly printed. How can I solve it?
How do you think about seperating UI and print-object-part?
from console-surfing-game.
@foba1 Yes, I should've mentioned the rendering order of UI elements. I thought overlapping problems can be solved with code orders below.
// SceneManager.cpp
...
void Render()
{
...
Draw(); // renders objects on screen
...
DrawUI(); // renders UI elements on screen, overwriting the pixels written with Draw();
}
Since the UI elements should be on top of gameplay scene, this is how it should be done. And as I wrote above, separating Draw()
and DrawUI()
could make the code more readable. (or you can just write everything as in-line code in Render()
too)
from console-surfing-game.
μμ΄ μ΄λ €μμ νκΈλ‘ μ μ. λλ μ²μμ κ·Έλ κ² νλκ±Έλ‘ μκ°νλλ°, κ·Έλ¬λ©΄ κ²μ μ€λΈμ νΈκ° μ΄μνκ² μΆλ ₯λ κ±°κ°μμ μμ UIλ₯Ό μν 곡κ°λ§ λ°λ‘ λ§λλκ±°μ λν΄ μ΄λ»κ² μκ°νλλ κ±°μ§
from console-surfing-game.
Related Issues (20)
- There should only be 1 kraken
- ESC key doesn't work
- Kraken doesn't disappear HOT 1
- Kraken looks so scary
- Update Documentation
- Update Documentation
- Update UML diagram
- When Player stops, GameObjects accumulate. HOT 3
- About Diagram Problem HOT 1
- we need to add the player's speed to increase automatically, and create a speed limit for the player.
- When Kraken hit Obstacles, it need to be gone. HOT 3
- After player revives, it need to blink.
- When player stops, Kraken also stops. HOT 4
- Sometimes GameObject are generated overlapped HOT 1
- Objects being generated multiple times on the same position
- Apply doxygen
- Kraken getting deleted before showing in screen
- Sometimes Kraken passes gameobject.
- After kraken died, it can't be generated.
- Player's hitbox is too big HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console-surfing-game.