forums.evilmana.com
Welcome, Guest. Please login or register.

Login with username, password and session length
July 29, 2010, 01:43:27 PM
.
News: 06/10/2009 - New Features For Forum.
Friendly URLs, twitter for profile, and video site URLs will auto-display the video.
Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read February 07, 2010, 05:42:09 PM #0
faboyXIIV

Please help out a noOb

hello all,
I'm in my second day of programming lua and i need help.
I'm just doing a basic "drawing" program for my PSP trying too get better
I came form doing a similar program on 'qbasic and i cant get the screen to clear when I press R trigger Hissy Fit

in using luaplayer euphoria V8 and here is my code  Blinky Smile
**************************************************
--variables
blue = Color.new(0, 0, 225)
green = Color.new(0, 225, 0)
red = Color.new(225, 0, 0)
white = Color.new(225, 225, 225)
x=100
y=100
z=0

--starting point and instructions
screen:print(x, y, "O", red)
screen:print(10, 10, "cross is blue, triangle is green, circle is red", white)
screen:print(20, 20, "and square resets the cursor", white)
screen:print(200, 200, "BY NICK COCHRAN", white)

--main program
while true do
   pad = Controls.read()

   if pad:r() then
      screen:clear()
   end

      if pad:up() and z == 0 then
         y=y-1
         screen:print(x, y, ".", red)
      end

      if pad:down() and z == 0 then
         y=y+1
         screen:print(x, y, ".", red)
      end

      if pad:left() and z == 0 then
         x=x-1
         screen:print(x, y, ".", red)
      end

      if pad:right() and z == 0 then
         x=x+1
         screen:print(x, y, ".", red)
      end

      if pad:square() then
         x=100
         y=100
         screen:print(x, y, "O", red)
      end

      if pad:triangle() then
         z=1
      end

      if pad:cross() then
         z=2
      end

      if pad:circle() then
         z=0
      end


      if pad:up() and z == 1 then
         y=y-1
         screen:print(x, y, ".", green)
      end

      if pad:down() and z == 1 then
         y=y+1
         screen:print(x, y, ".", green)
      end

      if pad:right() and z == 1 then
         x=x+1
         screen:print(x, y, ".", green)
      end

      if pad:left() and z == 1 then
         x=x-1
         screen:print(x, y, ".", green)
      end

      if pad:up() and z == 2 then
         y=y-1
         screen:print(x, y, ".", blue)
      end

      if pad:down() and z == 2 then
         y=y+1
         screen:print(x, y, ".", blue)
      end

      if pad:right() and z == 2 then
         x=x+1
         screen:print(x, y, ".", blue)
      end

      if pad:left() and z == 2 then
         x=x-1
         screen:print(x, y, ".", blue)
      end

screen.flip()
screen.waitVblankStart()
end
*******************************************************************************

plz help a noOp
PS: Ill add your name to it if you can help if you want  Wink
Offline  
Read February 17, 2010, 02:23:30 PM #1
dan369

Re: Please help out a noOb

Code:
screen:clear();
System.startDraw();


--your rendering code

System.endDraw();
screen.flip();

Though there are defiantly better ways in doing what your are trying todo. Also you'll probably need to call System.startDraw(); & endDraw(); between your printing code by:
--starting point and instructions
« Last Edit: February 17, 2010, 02:26:36 PM by dan369 »

Offline  
Pages: [1]   Go Up
Jump to:  

Theme Update by Runic Warrior Originally created by m3talc0re