Author Topic: Any way to do this easily?  (Read 2607 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Any way to do this easily?
« on: October 22, 2011, 06:00:06 pm »
So, I'm making a game with multiple floors on the screen. I made the sprite for the floor, but it is only up to 8 pixels in length with the hexpic program. Therefore, I have to put over 40 Pt-Ons to make enough floors. Is there a way to do this easily?

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Any way to do this easily?
« Reply #1 on: October 22, 2011, 06:21:33 pm »
You can do a For() loop:

[FFFF000000000000]→Pic1
##→Y
.Y is desired vertical position
For(A,0,11)
Pt-On(A*8,Y,Pic1)
End


Going through the loop once should draw a row of the sprite (in this case a 2-pixel thick line), going across the screen.

Btw if it's just a solid horizontal line, you can use Rect() to draw it in one command :)
« Last Edit: October 22, 2011, 06:22:14 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Any way to do this easily?
« Reply #2 on: October 23, 2011, 08:29:02 pm »
Thanks. Should have thought of that. Also probably just have put this in the Q&A thread. I nested the for in another one to make the multiple levels.