Search found 10 matches

by Lividpayment
February 21st, 2021, 10:17 pm
Forum: Everything
Topic: Best way to use an output function in a loop?
Replies: 1
Views: 2137

Best way to use an output function in a loop?

for (int curIndex = 0; curIndex < 1000; ++curIndex) { if (e.GetType() == Mouse::Event::Type::LPress) { pixelsX[curIndex] = wnd.mouse.GetPosX() - 5; pixelsY[curIndex] = wnd.mouse.GetPosY() - 5; } gfx.PutPixel(pixelsX[curIndex], pixelsY[curIndex], Colors::Red); } -------------------------------------...
by Lividpayment
February 8th, 2021, 5:00 pm
Forum: Everything
Topic: Dword unhandled exception
Replies: 2
Views: 2399

Re: Dword unhandled exception

Mine was coming from the fact the function couldn't access the information it needed from the graphics class, and throwing an error because of that.
by Lividpayment
January 31st, 2021, 1:56 pm
Forum: Everything
Topic: Dword unhandled exception
Replies: 2
Views: 2399

Dword unhandled exception

Unhandled exception thrown: write access violation. this was 0xACDB8 > Color& operator =( Color color ) { dword = color.dword; return *this; } ----------------------------------------------- Does anyone know what might be causing this error code? Its coming from inside the color class. Happened when...
by Lividpayment
January 21st, 2021, 9:22 pm
Forum: Everything
Topic: Mouse Loc
Replies: 1
Views: 2206

Mouse Loc

How do the coordinates of the mouse as a seperate raw int? I'm trying to create a little 2D draw tool that places a pixel whenever you press the left mouse button, but i'm stuck as my pixels just keep following the mouse :)
Thanks!
by Lividpayment
August 5th, 2020, 2:40 pm
Forum: Everything
Topic: Default constructor cannot be referenced it a deleted function
Replies: 1
Views: 2596

Default constructor cannot be referenced it a deleted function

Can you someone give me some idea of what type of error this might come from? I got when I tried to create a default constructor in the brick class for fart annoyed.
by Lividpayment
July 23rd, 2020, 9:13 pm
Forum: Everything
Topic: [Fart-Annoyed] RectF question
Replies: 1
Views: 2275

[Fart-Annoyed] RectF question

class RectF { public: RectF() = default; RectF(float left_in, float right_in, float top_in, float bottom_in); RectF(const Vec2& topleft, const Vec2& bottomright); RectF(const Vec2& topleft, float width, float height); static RectF FromCentre(const Vec2& centre, float halfwidth, float halfheight); b...
by Lividpayment
July 15th, 2020, 11:11 pm
Forum: Everything
Topic: Checking a variable against itself?
Replies: 2
Views: 2613

Checking a variable against itself?

if (wnd.mouse.RightIsPressed()) { BoardColor = Colors::Blue; } else { BoardColor = BoardColorAfterChanged; } Can anyone help with this problem? Basically whenever the right is pressed the board will change color, it works, but I was wondering there was a more elegant solution to reverse it back to t...
by Lividpayment
June 11th, 2020, 10:29 am
Forum: Everything
Topic: Snek game bug
Replies: 1
Views: 1669

Snek game bug

Hi. I'm getting a weird bug that I can't seem to track down(image linked). Does everyone know what is possibly might be? I just finished re-writing the homework for Snek game. Code below; Snake::Snake(const Location& loc) { constexpr int nBodyColors = 4; constexpr Color SnakeColor[nBodyColors] = { {...
by Lividpayment
May 21st, 2020, 10:34 pm
Forum: Everything
Topic: Pong collision detection
Replies: 2
Views: 1841

Pong collision detection

int BallWidth = xPos + width; int BallHeight = yPos + height; if (BallWidth >= PaddleX && xPos <= PaddleX + PaddleWidth && BallHeight >= PaddleY && yPos <= PaddleY + PaddleHeight) { vx + 1; BallWidth = PaddleX - 3; } if (BallWidth >= PaddleX && xPos <= PaddleX + PaddleWidth && BallHeight >= PaddleY ...
by Lividpayment
May 14th, 2020, 3:10 pm
Forum: Everything
Topic: Error code C26495
Replies: 1
Views: 1940

Error code C26495

Game.H #pragma once #include "Keyboard.h" #include "Mouse.h" #include "Graphics.h" #include "Player.h" #include "Platform.h" #include <random> #include "Item.h" class Game { public: Game(class MainWindow& wnd); Game(const Game&) = delete; Game& operator=(const Game&) = delete; void Go(); private: vo...