Giter VIP home page Giter VIP logo

Comments (28)

foba1 avatar foba1 commented on June 8, 2024 1

@ntcho I got it, thanks.

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024 1

@ntcho you are genious :)

from console-surfing-game.

ntcho avatar ntcho commented on June 8, 2024 1

@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.

ntcho avatar ntcho commented on June 8, 2024 1

@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.

ntcho avatar ntcho commented on June 8, 2024 1

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.

ntcho avatar ntcho commented on June 8, 2024 1

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.

foba1 avatar foba1 commented on June 8, 2024 1

@ntcho I realy understand it, very very thanks.

from console-surfing-game.

ntcho avatar ntcho commented on June 8, 2024 1

Oh yeah, player's position should seem static relative to the game frame. πŸ‘

from console-surfing-game.

ntcho avatar ntcho commented on June 8, 2024 1

ν™”λ©΄ 맨 μœ„ ν•œλ‘μ€„μ •λ„ UI 에 ν• λ‹Ήν•˜λŠ”κ±°λŠ” 뭐 κ²Œμž„ν”Œλ ˆμ΄μ— 지μž₯이 μ—†μœΌλ‹ˆ 그게 λ‚˜μ„κ²ƒ κ°™μœΌλ©΄ κ·Έλƒ₯ κ·Έλ ‡κ²Œ 해도 무방할듯!

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024 1

γ…‡γ…‹γ…‡γ…‹ λ‹€λ₯Έκ±° λ‹€λ§Œλ“€μ–΄μ§„λ‹€μŒμ— μ‹€ν–‰ν•˜λ©΄μ„œ 결정해도 무방할듯

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024

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.

ntcho avatar ntcho commented on June 8, 2024

@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.

foba1 avatar foba1 commented on June 8, 2024

@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.

ntcho avatar ntcho commented on June 8, 2024

@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.

foba1 avatar foba1 commented on June 8, 2024

@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.

foba1 avatar foba1 commented on June 8, 2024

@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.

foba1 avatar foba1 commented on June 8, 2024

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.

foba1 avatar foba1 commented on June 8, 2024

@ntcho In the game, player must exist at the center of console?

from console-surfing-game.

ntcho avatar ntcho commented on June 8, 2024

@foba1 Not exactly the center of the console, please check the render diagram.

image

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.

foba1 avatar foba1 commented on June 8, 2024

@ntcho I know, just ask it should always there. Thanks.

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024

@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.

ntcho avatar ntcho commented on June 8, 2024

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.

foba1 avatar foba1 commented on June 8, 2024

@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.

ntcho avatar ntcho commented on June 8, 2024

Oh yeah, I don't think we need different player characters. I left it out during the design process.

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024

Ok. I will make to print out the game guidelines in Ready scene. Thanks.

from console-surfing-game.

foba1 avatar foba1 commented on June 8, 2024

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.

ntcho avatar ntcho commented on June 8, 2024

@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.

foba1 avatar foba1 commented on June 8, 2024

μ˜μ–΄ μ–΄λ €μ›Œμ„œ ν•œκΈ€λ‘œ 적음. λ‚˜λ„ μ²˜μŒμ—” κ·Έλ ‡κ²Œ ν•˜λŠ”κ±Έλ‘œ μƒκ°ν–ˆλŠ”λ°, 그러면 κ²Œμž„ μ˜€λΈŒμ νŠΈκ°€ μ΄μƒν•˜κ²Œ 좜λ ₯λ κ±°κ°™μ•„μ„œ μ•„μ˜ˆ UIλ₯Ό μœ„ν•œ κ³΅κ°„λ§Œ λ”°λ‘œ λ§Œλ“œλŠ”κ±°μ— λŒ€ν•΄ μ–΄λ–»κ²Œ μƒκ°ν•˜λƒλŠ” 거지

from console-surfing-game.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.