Hello, I am making a program that will draw a ramps for a bike game. It does that by making many lines which form a ramp or other figures. For one of the ramps I have a small problem. In the game if something is too smooth, it will slip and go to fast and fall (this is a bug). Because my program makes super smooth ramps, the bikes slips and falls. To see what I am talking about go here . And press up. It will go super fast and start spinning. This is not supposed to happen. I want to make it less smooth by drawing an extra layer on top of the ramp.
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main() {
Sleep(5000);
int sx = 700;
int sy = 200;
int startx[25]; //this is so the ramp will not be slippery
int starty[25]; //this is so the ramp will not be slippery
float count = 0; //then we add 0.25
float counti = 0; //other count too see which element in the array to fill
int ex = 700;
int ey = 500;
int i = 0;
for (i = 0; i < 200; i++) {
count+=0.25;
if (count == 2) {
count = 0;
startx[(int)counti] = sx;
starty[(int)counti] = sy;
counti++;
}
sy+=1;
sx-=1;
SetCursorPos(sx,sy);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
ex-=3;
SetCursorPos(ex,ey);
Sleep(150);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(150);
}
int d = 0;
while (d < 24) {
SetCursorPos(startx[d]-1,starty[d]-1);
d++;
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
SetCursorPos(startx[d]-1,starty[d]-1);
Sleep(150);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(150);
}
}
To run the program, you should quickly switch to canvas rider drawer or any other painting program (like Windows Paint). But as you may see, the layer does not draw correctly. I can't figure out how to make it go right on top layer of ramp. So how do you think I can do this?