Transparent textures do not render properly
I was using raylib and instead of partially showing the texture behind it’s just black.
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
(raylib) exit code: -1073741819 (0xc0000005)
I’m using visual studio and I made this program with raylib to draw text (using a different font) in a window.
And then this happened:
myprogram.exe (process 28468) exited with code -1073741819 (0xc0000005)
This is the source code:
Collisions in Raylib C++
your text
#include “raylib.h”
your text
#include <stdio.h>
your text
your text
struct square
your text
{
your text
// Variables
your text
float x, y;
your text
float w, h;
your text
float gravity;
your text
float velocity;
your text
your text
Rectangle GetRectangle() { // x w h
your text
return Rectangle{ x – w / 2, y – h / x, 80, 80 };
your text
}
your text
int drawsquare() {
your text
DrawRectangleRec(GetRectangle(), RED);
your text
return 0;
your text
}
your text
};
your text
struct obby
your text
{
your text
// Variables
your text
float x, y;
your text
float w, h;
your text
your text
Rectangle GetRectangle() {
your text
return Rectangle{ x, y, w, h };
your text
}
your text
int drawobby() {
your text
DrawRectangleRec(GetRectangle(), BROWN);
your text
return 0;
your text
}
your text
};
your text
your text
int currentLevel = 1;
your text
your text
int main(void)
your text
{
your text
InitWindow(1100, 700, “Basic Platformer”);
your text
your text
SetWindowState(FLAG_VSYNC_HINT);
your text
your text
// Player Attributes
your text
square player;
your text
player.x = 100;
your text
player.y = 400;
your text
player.w = 80;
your text
player.h = 80;
your text
player.gravity = 0.0f;
your text
player.velocity = 0.15f;
your text
your text
// Floor Attributes
your text
obby floor1;
your text
floor1.x = 50;
your text
floor1.y = 575;
your text
floor1.w = 160;
your text
floor1.h = 30;
your text
your text
// DeltaTime
your text
float deltaTime = GetFrameTime();
your text
your text
// Sets the FPS
your text
SetTargetFPS(60);
your text
your text
// While Window is Open
your text
while (!WindowShouldClose())
your text
{
your text
// Player Gravity / Physics
your text
player.gravity += player.velocity;
your text
player.y += player.gravity;
your text
your text
// Collisions
your text
if (CheckCollisionRecs(player.GetRectangle(), floor1.GetRectangle())) {
your text
player.y = floor1.y – 80;
your text
player.gravity = 0;
your text
}
your text
your text
// Input
your text
if (IsKeyPressed(KEY_W)) {
your text
player.gravity = -5;
your text
}
your text
else if (IsKeyDown(KEY_A)) {
your text
player.x -= 4;
your text
}
your text
else if (IsKeyDown(KEY_D)) {
your text
player.x += 4;
your text
currentLevel = 2;
your text
}
your text
your text
BeginDrawing();
your text
your text
// Level 1
your text
if (currentLevel == 1) {
your text
void Level1(void);
your text
{
your text
floor1.drawobby();
your text
}
your text
}
your text
your text
// Level 2
your text
if (currentLevel == 2) {
your text
void Level1(void);
your text
{
your text
your text
}
your text
}
your text
your text
// Level 3
your text
if (currentLevel == 3) {
your text
void Level1(void);
your text
{
your text
your text
}
your text
}
your text
your text
ClearBackground(GRAY);
your text
player.drawsquare();
your text
your text
EndDrawing();
your text
your text
// DeltaTime
your text
deltaTime = GetFrameTime();
your text
}
your text
your text
your text
CloseWindow();
your text
your text
return 0;
your text
}
problems with collsions wit tilemap raylib C++
Yes hello all. I’m having a problems with my collisions in my demo I’m making. Sometimes the player collides with objects and sometimes they pass right through also they get stuck on side of objects, or reverses it’s movement.I hope someone can put code in ide and tell me what’s going on. I’m a beginner and I’ve tried all I know. I don’t know if it’s because I’m using different sizes for the tile map and players, or what’s going on. I want player to not move when they walks into gray box any help is appreciated. Thanks.
Drawing simple shapes in raylib c
I can draw text, but I cannot seem to figure out how to draw shapes in raylib c: