Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot cars all need to be different colours #23

Closed
togfoxy opened this issue Apr 13, 2023 · 1 comment
Closed

Bot cars all need to be different colours #23

togfoxy opened this issue Apr 13, 2023 · 1 comment

Comments

@togfoxy
Copy link
Owner

togfoxy commented Apr 13, 2023

No description provided.

@togfoxy
Copy link
Owner Author

togfoxy commented Apr 14, 2023

function functions.loadImages()
	IMAGE[enum.imageCell] = love.graphics.newImage("assets/images/cell_32x16.png")
	IMAGE[enum.imageCellShaded] = love.graphics.newImage("assets/images/cellshaded_32x16.png")
	IMAGE[enum.imageCellFinish] = love.graphics.newImage("assets/images/cellfinish_32x16.png")
	IMAGE[enum.imageCar] = love.graphics.newImage("assets/images/car_64x29.png")
	IMAGE[enum.imageTrack] = love.graphics.newImage("assets/images/track.jpg")
	
	CARIMAGE[1] = love.graphics.newImage("assets/images/car1.png")
	CARIMAGE[2] = love.graphics.newImage("assets/images/car2.png")
	CARIMAGE[3] = love.graphics.newImage("assets/images/car3.png")
	CARIMAGE[4] = love.graphics.newImage("assets/images/car4.png")
	CARIMAGE[5] = love.graphics.newImage("assets/images/car5.png")
	CARIMAGE[6] = love.graphics.newImage("assets/images/car6.png")
end



-- draw the cars
for i = 1, numofcars do
    local drawx = racetrack[cars[i].cell].x
    local drawy = racetrack[cars[i].cell].y

    if cars[i].isEliminated then
        love.graphics.setColor(1,0,0,1)     -- red for crash
    else
        love.graphics.setColor(1,1,1,1)     -- white
    end
	
    love.graphics.draw(CARIMAGE[currentplayer], drawx, drawy, racetrack[cars[i].cell].rotation , 1, 1, 32, 15)
end	

@togfoxy togfoxy closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant