MKLIUKANG1
Active member
That was a struggle, but it's finally working. Thx ))Nice work on the password system.
That was a struggle, but it's finally working. Thx ))Nice work on the password system.
Thx. This is an empty level; everything else is rendered using "drawstring" and "drawbox"The Sound Test system looks professional! Are the bars in drawbox or are they models? Excellent job!
The idea is great, but I think there is too much things happening at the same time. Everything moves and blinks way too much (for example, the CPU box should not float like that), the noise and scanline are way too strong and those purple and blue rectangles makes everything too noisy to read.A custom music player implemented on the OpenBOR engine using C-Script. This is more than just a menu; it's a full simulation of a retro gadget, rendered from scratch using geometric primitives.
Thanks for the rating! I agree, there was too much visual noise. In the latest update, I removed the VHS effect, extra stripes, and the CPU indicator to make the interface cleaner and keep the focus on the music. I kept only the essentials to maintain that retro vibe.Отличная работа, великолепная техническая реализация!
На экране слишком много шума и помех:
думаю, нескольких сканирований и немного снега было бы достаточно.
Thanks! Yeah, I definitely overdid it with the effects. I've already removed the extra ones to clean things up.The idea is great, but I think there is too much things happening at the same time. Everything moves and blinks way too much (for example, the CPU box should not float like that), the noise and scanline are way too strong and those purple and blue rectangles makes everything too noisy to read.
updated data/scripts/updated.c
Music Data/Music/big_apple.ogg 1
Order a
BGSpeed 0
Direction both
CameraType 0
NoTime 1
SetTime 0
NoJoin 1
NoPause 0
Scrollspeed 1
Type 2
spawn1 0 50
spawn2 100 150
Light -200 150
At 0
#Objects------------------------------------------------------------------------------#
void draw_road_item(void sprite, int dist, int side) {
if(!sprite) return;
int screen_w = 480;
int horizon_y = getglobalvar("current_h_val");
int road_curve = getglobalvar("road_curve");
if(road_curve == NULL()) road_curve = 0;
// Perspective logic: dist 1000 (far) -> 0 (near player)
if(dist < 50 || dist > 950) return;
int inv_dist = 1000 - dist;
int scale = (inv_dist * 256) / 1000; // Scale 0-256
// Y Position
int y_pos = horizon_y + (inv_dist * 172 / 1000);
// X Position with curve factor
int road_w = 40 + (inv_dist * 2 / 10);
int shift = (road_curve * inv_dist * inv_dist) / 300000;
int x_pos = (screen_w / 2) + shift + (side * road_w / 2);
// Object offset from the road edge
if(side > 0) x_pos += (15 * scale / 256);
else x_pos -= (45 * scale / 256);
setdrawmethod(NULL(), 1, scale, scale, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL());
drawsprite(sprite, x_pos, y_pos - (80 * scale / 256), 10, 0);
setdrawmethod(NULL(), 0, 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL());
}
// MAIN ROAD RENDERING FUNCTION
void draw_pseudo_3d_road() {
int screen_w = 480;
int screen_h = 272;
int horizon_y = 100;
int time = openborvariant("elapsed_time");
// 1. HILL PARAMETERS (Sine wave on integers)
int hill_wave = (time / 4) % 360;
int hill_offset = (sin(hill_wave) * 20) / 1000;
int current_horizon = horizon_y + hill_offset;
setglobalvar("current_h_val", current_horizon);
// 2. TRACK DATA
int road_offset = getglobalvar("road_pos");
int main_curve = getglobalvar("road_curve");
if(main_curve == NULL()) main_curve = 0;
if(road_offset == NULL()) road_offset = 0;
// --- SKY (Gradient) ---
int s;
for(s = 0; s < current_horizon; s += 5) {
int sky_r = 20 + (s / 4);
int sky_g = 40 + (s / 2);
int sky_b = 150 + (s / 3);
drawbox(0, s, screen_w, 5, 1, rgbcolor(sky_r, sky_g, sky_b), 0);
}
// --- FOG ---
drawbox(0, current_horizon - 4, screen_w, 4, 3, rgbcolor(120, 160, 230), 0);
// --- ROAD RENDERING LOOP ---
int road_h = screen_h - current_horizon;
int i;
for(i = 0; i < road_h; i += 2) {
int perspective_factor = (road_h - i);
int shift = (main_curve * perspective_factor * perspective_factor) / 3000;
int road_w = 40 + (i * 2);
int x1 = (screen_w / 2) - (road_w / 2) + shift;
// Alternating stripes (Moving forward)
int is_alt = ((i * 4 + (800 - (road_offset % 800))) % 160 > 80);
int col_grass = is_alt ? rgbcolor(15, 80, 15) : rgbcolor(25, 110, 25);
int col_road = rgbcolor(50, 50, 60);
int col_side = is_alt ? rgbcolor(220, 220, 220) : rgbcolor(180, 0, 0);
drawbox(0, current_horizon + i, screen_w, 2, 5, col_grass, 0);
drawbox(x1, current_horizon + i, road_w, 2, 6, col_road, 0);
int side_w = 2 + (i / 12);
drawbox(x1 - side_w, current_horizon + i, side_w, 2, 7, col_side, 0);
drawbox(x1 + road_w, current_horizon + i, side_w, 2, 7, col_side, 0);
if (is_alt) {
int line_w = 2 + (i / 20);
drawbox(x1 + (road_w / 2) - (line_w / 2), current_horizon + i, line_w, 2, 8, rgbcolor(255, 255, 255), 0);
}
}
}
// --- PSEUDO-3D ROAD INTEGRATION ---
// Condition: in level
if(openborvariant("in_level")) {
int is_p = getglobalvar("is_pass_active");
int is_s = getglobalvar("is_soundtest");
int is_d = getglobalvar("d_active");
if(is_p != 1 && is_s != 1 && is_d != 1) {
// Checking if we are in the racing level via a custom global var
if(getglobalvar("Show") == "X") {
draw_pseudo_3d_road();
}
}
}
// Logic for movement and curves
if(openborvariant("in_level") && getglobalvar("Show") == "X") {
int r_pos = getglobalvar("road_pos");
if(r_pos == NULL()) r_pos = 0;
setglobalvar("road_pos", r_pos + 20); // Driving speed
// Smooth curving logic
int r_cur = getglobalvar("road_curve");
if(r_cur == NULL()) r_cur = 0;
// Example scenario: turn right at 1000m, turn left at 4000m
int target = 0;
if(r_pos > 1000 && r_pos < 3000) target = 100;
else if(r_pos > 4000 && r_pos < 7000) target = -150;
else if(r_pos > 5000 && r_pos < 6000) setglobalvar("target_curve", 80);
if(r_cur < target) r_cur += 1;
if(r_cur > target) r_cur -= 1;
setglobalvar("road_curve", r_cur);
}
} // Main function closing bracket
void spr = loadsprite("data/bgs/road/tree.png");
setglobalvar("tree_sprite", spr);
draw_road_item(getglobalvar("tree_sprite"), 500, -1); // Tree at 500m distance, left side