Jump to content




Help with Mario game redraw function


  • You cannot reply to this topic
5 replies to this topic

#1 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 02 February 2013 - 01:52 PM

Hi all! I am trying to create a Mario game in CC, and need help with the redraw function, because all it does is print an "@" at Mario's head. The getMario is just for debugging.

Code:
Spoiler

Thanks in advance for your help! ;)

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 February 2013 - 01:59 PM

what is this file it loads from. trying to test and can't due to the load function not working.

#3 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 02 February 2013 - 02:01 PM

Oh ok. File Code:
###########
###########
###########
###########
###########
###########
###########

Just for testing.... XP

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 February 2013 - 02:13 PM

seems to me like the problem is actually in the drawMario not redraw

Using this code I was able to get @ and # to draw fine
local function drawMario()
  local x,y = term.getCursorPos()
  term.setCursorPos(mario.x,mario.y)
  write("@")
  term.setCursorPos(mario.x,mario.y+1)
  write("#")
  term.setCursorPos(x,y)
end


#5 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 02 February 2013 - 02:17 PM

View PostTheOriginalBIT, on 02 February 2013 - 02:13 PM, said:

seems to me like the problem is actually in the drawMario not redraw

Using this code I was able to get @ and # to draw fine
local function drawMario()
  local x,y = term.getCursorPos()
  term.setCursorPos(mario.x,mario.y)
  write("@")
  term.setCursorPos(mario.x,mario.y+1)
  write("#")
  term.setCursorPos(x,y)
end

Yes, thanks, but it still doesn't draw the blocks... :(

#6 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 03 February 2013 - 05:32 AM

Sorry for bumping, but I still can't figure out why it won't work... :(





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users