Author Topic: Squares  (Read 3152 times)

0 Members and 1 Guest are viewing this topic.

Offline kevinkore3

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +0/-0
    • View Profile
Squares
« on: June 10, 2014, 06:53:31 pm »
Simple squares game (mainly testing ndless)
Press R to restart
In case you're wondering why I created the tempw array, it was because there was some glitch that randomly changed the w and h part of SDL_Rect (can't find it, be thankful if someone can).

To do:
Figure out how to draw text (Probably gonna have to use NTI images :L) - did with SetPoint :P
Fix glitch where they randomly congregate at the corner (kind of fixed meh)
Get nSDL_DrawString to work

Edit:
OK, I noticed that the squares exited and entered smoothly on the right and bottom sides, but not on the left and top sides (x<0 and y<0), so I'm guessing that nSDL, unlike SDL2, doesn't support drawing rectangles with negative x and y coordinates :P
« Last Edit: June 12, 2014, 10:22:18 pm by kevinkore3 »

Offline Legimet

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +29/-0
    • View Profile
Re: Squares
« Reply #1 on: June 11, 2014, 02:55:39 pm »
You can draw text either using nSDL's built-in font support, Freetype, which I compiled for Nspire and is now in the Ndless SDK, or charmaps (there's one in nRGBlib). Don't make NTI images for that.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Squares
« Reply #2 on: June 11, 2014, 09:57:59 pm »
I'll try this when I have a chance. By the way a good rule of thumb for a calculator project is to include screenshots when posting about it. It will draw more attention since people generally like to see how a game looks like before downloading it. :)

EDIT: I see you edited your post. Thanks for the screenie :D
« Last Edit: June 13, 2014, 12:44:09 am by DJ Omnimaga »

Offline kevinkore3

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +0/-0
    • View Profile
Re: Squares
« Reply #3 on: June 12, 2014, 10:22:37 pm »
Any way to convert int to string with ndless?