ok what do i do after this
Printable View
ok what do i do after this
We will add some controls now enter this
-----------------------------------------------------------------
This moves the car up and down
-----------------------------------------------------------------
if pad:up() then
character = car1
player.y = player.y - 2
end
if pad:down() then
character = car1
player.y = player.y + 2
end
-----------------------------------------------------------------
This moves the car left and right
-----------------------------------------------------------------
if pad:left() then
character = car1
player.x = player.x - 2
end
if pad:right() then
character = car1
player.x = player.x + 2
end
------------------------------------------------------------------
Enter that in to your code
ok its in my code now...what next
Now save as script.lua
And run it
it says error: script.lua:7: Image.load: Error loading image.
aahhhhh you have your first error do you have both of the images i posted here
This is the error here
---------------------------------------------------------------------------------------------------
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
road=Image.load("images/weapon.PNG")
background=weapon
car1=Image.load("images/car1.PNG")
player1=car1
What you need to do is remove the word images on both of them just remove the word images nothing else
yea i noticed that but it still says i have an error on line seven. this is what i have in my script
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
weapon=Image.load("weapon.PNG")
background=weapon
car1=Image.load("car1.PNG")
player1=car1
do you have both of the images i posted on this site
save them as PNG
Save the background as weapon.PNG
and the car as car1.PNG
ok i got that to work...now when i run it it tells me
errors: script.lua:12: attempt to index global 'pad' (a nil value)
for me line 12 is
player.y = player.y - 2
Post your whole script here