help
Author |
Message |
ilovepandas
|
Posted: Wed May 30, 2018 8:44 am Post subject: help |
|
|
Hey, i need help with my program, do i post the code here? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Wed May 30, 2018 7:54 pm Post subject: RE:help |
|
|
You're welcome to post your question and any relevant code in the appropriate forum. |
|
|
|
|
|
ilovepandas
|
Posted: Fri Jun 01, 2018 7:44 am Post subject: RE:help |
|
|
so i'm creating this game wanting to make my character move, i drew him on photoshop and brought him, but the problem is that it leaves trails and its really messed up, so how could i solve that? Also, i know that Sprite could help me but i dont know how to code that, heres my code:
var i : array char of boolean
var bugs_front : int := Pic.FileNew ("bugsbunny.jpg")
var bugs_back : int := Pic.FileNew ("bugback.jpg")
var bugs_right : int := Pic.FileNew ("bugsright.jpg")
var bugs_left : int := Pic.FileNew ("bugsleft.jpg")
var background : int := Pic.FileNew ("ugh.jpg")
var background1 : int := 1
var row : int := 320
var column : int := 200
%%%%%%%%%%%%%%%%
setscreen ("graphics:1000;1000")
Pic.Draw (bugs_right, row, column, picMerge)
Pic.Draw (background, 1, 1, picUnderMerge)
loop
Input.KeyDown (i)
if i (KEY_UP_ARROW) then
if background1 = 1 then
Pic.Draw (background, 1, 1, picCopy)
end if
if column <= 800 then
Pic.Draw (bugs_back, row, column + 5, picMerge)
column := column + 5
delay (15)
else
Pic.Draw (bugs_back, row, column, picMerge)
end if
end if
if i (KEY_RIGHT_ARROW) then
if background1 = 1 then
Pic.Draw (background, 1, 1, picCopy)
end if
if background1 = 1 then
if row = 1200 and column > 400 and column < 500 then
background1 := background1 + 1
row := 1
column := 400
elsif row <= 1200 then
Pic.Draw (bugs_right, row + 5, column, picMerge)
row := row + 5
delay (15)
else
Pic.Draw (bugs_right, row, column, picMerge)
end if
else
if row <= 1200 then
Pic.Draw (bugs_right, row + 5, column, picMerge)
row := row + 5
delay (15)
else
Pic.Draw (bugs_right, row, column, picMerge)
end if
end if
end if
if i (KEY_LEFT_ARROW) then
if background1 = 1 then
Pic.Draw (background, 1, 1, picCopy)
end if
if row >= 0 then
Pic.Draw (bugs_left, row - 5, column, picMerge)
row := row - 5
delay (15)
else
Pic.Draw (bugs_left, row, column, picMerge)
end if
end if
if i (KEY_DOWN_ARROW) then
if background1 = 1 then
Pic.Draw (background, 1, 1, picCopy)
end if
if column >= 0 then
Pic.Draw (bugs_front, row, column - 5, picMerge)
column := column - 5
delay (15)
else
Pic.Draw (bugs_front, row, column, picMerge)
end if
end if
end loop |
|
|
|
|
|
Insectoid
|
Posted: Sun Jun 03, 2018 10:52 am Post subject: RE:help |
|
|
To erase the trails you need a cls somewhere in your code. |
|
|
|
|
|
|
|