ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > CopperCube Open discussion
forum topic indicator Ideas to make top gear Snes in Coppercube
person icon
andgameplay
Registered User
Quote
2023-07-09 03:40:05

Hello devs! I'm thinking here, is it possible to create a racing game in Coppercube in 2D, but simulating 3D? For example Top gear from Snes or Outrun from Megadrive.

In this same style, I imagine an infinite racing game like Atari's enduro, in which the track is infinite, has random curves and rival cars appear on the scene also randomly. I'm trying to create something similar without using codes, is it possible? Do you have any advice or tips? Thank you very much!

embedded external image
🔎︎


person icon
VP
Guest
Quote
2023-07-12 08:05:50

To a road sweep left/right, use billboards to make horizontal strips of your scene and move them (left and right) in parallax to each other - billboards at the middle (horizon) of the screen should move more - billboards at the bottom shouldn't move left and right. A simple way to do this is to move the camera left/right with the player's car - place the billboard strips in layers so the lowst strips are closer to the camera than the higher strips.

For making the road roll forward, use separate billboards for road-lines, road-signs, grass/rocks/mountains/trees etc and move them towards the camera when the car accelerates.

For car steering/crashing, finally have a separate billboard for the car with on proximity events for centre/left/right of the screen, swap the sprite of the car to make it look like it's turning, depending where it is in relation to the screen.

You can use on proximity events on the mountains/signs/rocks to make the car crash, by triggering different sounds and changing the texture of the car's billboard to an 2D sprite animation when it comes into proximity with the other billboards.

For different levels, simply swap out the billboard images with different scene/hazards/car.

If you want, I can make this as a ccb template for you, would probably take me a week to finish it for you.

person icon
VP
Guest
Quote
2023-07-12 08:52:12

Some more info I just found....

http://www.extentofthejam.com/ps...

person icon
VP
Guest
Quote
2023-07-12 09:02:40

In fact, thinking about it, it may be even simpler to do. You could probably just use Every few seconds: "Shoot": to fire a section of the road forward quickly to make a blitter snake effect as the road segments are projected in front of the car sprite. This would give the road left/right/up/down curves. There may be an issue with speed in up/slowing down the road though. Not sure, I'd have to check

person icon
andgameplay
Registered User
Quote
2023-07-12 20:23:19

Hi VP. thanks for all your support, you are very kind and helpful!

Your idea is very good, I'm seeing is really possible to do a game like this.

it's amazing, everything is possible to do on coppercube without using codes!

Thanks for the tips and the link, I'm studing this possibility, I love these racing 2D games, I would like to create one like this


I thought of creating something using bilboards, you organized the ideas better, I'll try to do something.

Use the "shoot action" to fire sections of the road is other excellent idea!

person icon
SamGrady
Guest
Quote
2023-07-13 04:59:54

find my old example from time when i try html, create this algorithm for fun so i'm not sure about how it can be implemented in game (cuz i create it as page background), anyway i hope math inside can help you

<!DOCTYPE html>
<html>
<head>
<style>
body{margin: 0; padding: 0; overflow: hidden;}
</style>
</head>
<body>
<canvas id="gameCanvas"></canvas>
<script>
const canvas = document.getElementById('gameCanvas'); // Get the canvas element from the HTML document
const context = canvas.getContext('2d'); // Get the 2D rendering context of the canvas
// Set the canvas width and height to match the window size
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var turn = (1 - Math.round(Math.random() * 2)) * 300; // Initialize the turn variable with a random value that determines the initial movement direction
var px = 0; // Initialize the position variable to 0
var roadM = 0; // Initialize the road marker variable
function update() { // Function to update the game state and render the scene
context.clearRect(0, 0, canvas.width, canvas.height);// Clear the canvas
// Update the position based on the turn value
if (px > turn) px -= 10;
else if (px < turn) px += 10;
else if (px == turn) turn = (1 - Math.round(Math.random() * 2)) * 300;
// Draw road lines
for (r = 0; r < 31; ++r) roadLine((px * 10) / (40 - r), r * 10);
requestAnimationFrame(update); // Request the next animation frame to continue the update loop
}
function roadLine(pos, depth) { // Function to draw a road line
// Calculate the width and position of the road line based on depth
var w = canvas.width - 600 - depth * 2;
var p = (canvas.width - w) / 2 + pos;
// Fill the bottom part of the canvas with a green color
context.fillStyle = 'green';
context.fillRect(0, canvas.height - depth, canvas.width, 10);
// Fill the road section with a gray color
context.fillStyle = 'gray';
context.fillRect(p, canvas.height - depth, w, 10);
// Draw a white rectangle as a road marker at specific intervals
context.fillStyle = 'white';
if (roadM == 15 || roadM == 16 || roadM == 17) context.fillRect(p + (w / 2), canvas.height - depth, w / 50, 10);
else if (roadM == 20) roadM = 0;
roadM += 1; // Increment the road marker counter
}
update(); // Start the game loop
</script>
</body>
</html>

people who know math, don't judge me, i made it when i was young and dumb

person icon
SamGrady
Guest
Quote
2023-07-13 05:05:45

embedded external image
🔎︎


person icon
andgameplay
Registered User
Quote
2023-07-13 15:51:40

Hi SamGrady, thanks for share this html code, this is what I'm thinking! I don't know very well use codes in Coppercube, but I will study the math behind this code, is perfect, with this is possible to create a endless race game!


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |