Discord
Login
Community
DARK THEME

why is my sprite not showing? (i use quickengine)

player = object player.x = 0 player.y = 0 player.vx = 0 player.vy = 0 //0 is gail and 1 is biscuit character = 0 screen.draw("playeridle",20,0,20,0) end

You are drawing outside of a function, first off. Second: Read the damn docs. Atp I can't tell if this is either a troll post or straight up ignorance.

https://microstudio.dev/i/gilles/quickengine/

Because there it is telling you very precisely what you have to do and how you can set up a sprite. Programming isn't "Haha, I type random code by looking at the docs for 2 seconds and then just typing a bunch of nonsensical code". Think about it for a second. Even if the function WAS called, it would run only ONCE. Unless you are not clearing your screen, you would never see the sprite, not even for a microsecond.

Before writing posts in the future, please just read the damn docs, they are there to solve questions like this.

player = object
  player.x = 0
  player.y = 0
  player.vx = 0
  player.vy = 0 //0 is gail and 1 is biscuit character = 0
  screen.draw("playeridle",20,0,20,0)
end

If that is your code for that part, then you should know that you can't put code in a object unless your defining a function, and that is not how you make a object, and the height is set to 0, it should be more like:

player = object
  x = 0
  y = 0
  vx = 0
  vy = 0
  render = function() // The function render() still needs to be called.
    screen.drawSprite("playeridle",0,0,20,20) // screen.drawSprite(sprite,x,y,width,[height])
  end
end

You can get the player data in the function be prefixing player. like you were to get:

render = function()
  screen.drawSprite("playeridle",player.x,player.y, 20 20)
end

You can learn more at: https://microstudio.dev/documentation/microScript-cheatsheet/

edit: I still was writing this when you posted @confusedcatgirl, and I agree.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community