data/full_repos/permissive/502744275/ball_alt.sv
1: b"%Error: data/full_repos/permissive/502744275/ball_alt.sv:115: Can't find definition of variable: 'Ball_Y_Gravity'\n   Ball_Y_Int <= Ball_Y + Ball_Y_Vel + Ball_Y_Gravity;\n                                       ^~~~~~~~~~~~~~\n%Error: Exiting due to 1 error(s)\n"
module ball (
	input Reset, frame_clk,
	input [7:0] keycode0,
	input [7:0] keycode1,
	input [7:0] keycodeshoot,
	output logic [9:0] Ball_X,
	output logic [9:0] Ball_Y


);

	parameter [9:0] Ball_X_Center = 10;
	parameter [9:0] Ball_Y_Center = 250;
	parameter [9:0] Ball_X_Min = 10;
	parameter [9:0] Ball_X_Max = 560;
	parameter [9:0] Ball_Y_Min = 10;
	parameter [9:0] Ball_Y_Max = 250;

	logic On_Ground;
	logic Is_Jump;
	logic [9:0] Jump_Counter;

	logic [9:0] Ball_X_Int, Ball_Y_Int;
	logic [9:0] Ball_X_Vel, Ball_Y_Vel;

	logic [9:0] Ball_Y_Jump_Vel;



	always_ff @(posedge frame_clk) begin
		if (Reset) begin
			Ball_X_Vel <= 0;
			Ball_Y_Vel <= 0; 
			Ball_X_Int <= 0;
			Ball_Y_Int <= 0;
			Ball_X <= Ball_X_Center;
			Ball_Y <= Ball_Y_Center;
		end
		else begin
			if (keycode1) begin
				case (keycode1)
					8'h04 : begin
							Ball_X_Vel <= -10;
					end
					8'h07 : begin
							Ball_X_Vel <= 10;
					end
					8'h16 : begin
						  Ball_Y_Vel <= 10;
					end
					8'h1A : begin
            Ball_Y_Vel <= -10;
					end
					default: begin
            if (Ball_X / 10 == 0) begin
							Ball_X_Vel <= 0;
							Ball_Y_Vel <= 10;
						end
					end
				endcase
			end
			else if (keycode0) begin
        case (keycode1)
					8'h04 : begin
							Ball_X_Vel <= -10;
					end
					8'h07 : begin
							Ball_X_Vel <= 10;
					end
					8'h16 : begin
						  Ball_Y_Vel <= 10;
					end
					8'h1A : begin
            Ball_Y_Vel <= -10;
					end
					default: begin
            if (Ball_X / 10 == 0) begin
							Ball_X_Vel <= 0;
							Ball_Y_Vel <= 10;
						end
					end
				endcase
			end
			else begin
				if (On_Ground) begin
					Ball_X_Vel <= 0;
					Ball_Y_Vel <= 0;
				end
				else begin
					Ball_Y_Vel <= Ball_Y_Jump_Vel;
				end
			end

			Ball_X_Int <= Ball_X + Ball_X_Vel;
			Ball_Y_Int <= Ball_Y + Ball_Y_Vel + Ball_Y_Gravity;

			if (Ball_X_Int >= Ball_X_Min && Ball_X_Int <= Ball_X_Max) begin
				Ball_X <= Ball_X_Int;
			end

			if (Ball_Y_Int >= Ball_Y_Min && Ball_Y_Int <= Ball_Y_Max) begin
				Ball_Y <= Ball_Y_Int;
			end
		end
	end
endmodule
module ball (
	input Reset, frame_clk,
	input [7:0] keycode0,
	input [7:0] keycode1,
	input [7:0] keycodeshoot,
	output logic [9:0] Ball_X,
	output logic [9:0] Ball_Y


);


	parameter [9:0] Ball_X_Center = 10;
	parameter [9:0] Ball_Y_Center = 250;
	parameter [9:0] Ball_X_Min = 10;
	parameter [9:0] Ball_X_Max = 560;
	parameter [9:0] Ball_Y_Min = 10;
	parameter [9:0] Ball_Y_Max = 250;

	logic On_Ground;
	logic Is_Jump;
	logic [9:0] Jump_Counter;

	logic [9:0] Ball_X_Int, Ball_Y_Int;
	logic [9:0] Ball_X_Vel, Ball_Y_Vel;

	logic [9:0] Ball_Y_Jump_Vel;



	always_ff @(posedge frame_clk) begin
		if (Reset) begin
			Ball_X_Vel <= 0;
			Ball_Y_Vel <= 0; 
			Ball_X_Int <= 0;
			Ball_Y_Int <= 0;
			Ball_X <= Ball_X_Center;
			Ball_Y <= Ball_Y_Center;
		end
		else begin
			if (keycode1) begin
				case (keycode1)
					8'h04 : begin
							Ball_X_Vel <= -10;
					end
					8'h07 : begin
							Ball_X_Vel <= 10;
					end
					8'h16 : begin
						  Ball_Y_Vel <= 10;
					end
					8'h1A : begin
            Ball_Y_Vel <= -10;
					end
					default: begin
            if (Ball_X / 10 == 0) begin
							Ball_X_Vel <= 0;
							Ball_Y_Vel <= 10;
						end
					end
				endcase
			end
			else if (keycode0) begin
        case (keycode1)
					8'h04 : begin
							Ball_X_Vel <= -10;
					end
					8'h07 : begin
							Ball_X_Vel <= 10;
					end
					8'h16 : begin
						  Ball_Y_Vel <= 10;
					end
					8'h1A : begin
            Ball_Y_Vel <= -10;
					end
					default: begin
            if (Ball_X / 10 == 0) begin
							Ball_X_Vel <= 0;
							Ball_Y_Vel <= 10;
						end
					end
				endcase
			end
			else begin
				if (On_Ground) begin
					Ball_X_Vel <= 0;
					Ball_Y_Vel <= 0;
				end
				else begin
					Ball_Y_Vel <= Ball_Y_Jump_Vel;
				end
			end

			Ball_X_Int <= Ball_X + Ball_X_Vel;
			Ball_Y_Int <= Ball_Y + Ball_Y_Vel + Ball_Y_Gravity;

			if (Ball_X_Int >= Ball_X_Min && Ball_X_Int <= Ball_X_Max) begin
				Ball_X <= Ball_X_Int;
			end

			if (Ball_Y_Int >= Ball_Y_Min && Ball_Y_Int <= Ball_Y_Max) begin
				Ball_Y <= Ball_Y_Int;
			end
		end
	end
endmodule