Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Yommy

Pages: [1]
1
Bug Reports / RND allways outputs 1
« on: 2010-Jun-25 »
Code: (glbasic) [Select]
// --------------------------------- //
// Project: rnd
// Start: Friday, June 25, 2010
// IDE Version: 8.006

GLOBAL Tile = RND(500)
PRINT Tile,1,1
SHOWSCREEN
KEYWAIT

i have tried with various SEEDRND options, and still allways 1 :(
please can you look into this for me

Yommy <3

2
GLBasic - en / card fan problem
« on: 2009-Sep-06 »
im having alot of problems trying to fan some cards in an arc style
my current code is -
Code: (glbasic) [Select]
count = LEN(p1cards#[])
start = 380 - (count/2)*40 // x of first card
stepangle = 60/count
angle = 30
FOR i = 0 TO count -1

ROTOSPRITE p1cards#[i], i*40+start, 500-COS(angle)*100, angle
angle = angle - stepangle
IF angle < 0
angle = angle + 360
ENDIF

NEXT
which makes it look like



please can someone spot my mistake and explain what i am doing wrong
thanks

Yommy x

3
if i add 2 players to the server and then remove them in the order they was created
the last player stays in the server :(

server
Code: (glbasic) [Select]
WHILE TRUE
num% = NETNUMPLAYERS()
GLOBAL gIDs%[]
DIM gIDs%[num%]
PRINT "ID  - Player name",10,40
FOR i% = 0 TO num%-1
   gIDs%[i%] = NETGETPLAYERID(i%)
   PRINT gIDs%[i] + " - " + NETPLAYERNAME$(gIDs%[i%]),10,60+20*i
NEXT

WEND


4
Beta Tests / onscreen keyboard
« on: 2008-Jul-13 »
well i am trying to make an onscreen keyboard that i can use in future projects


Code: (glbasic) [Select]
// --------------------------------- //
// Project: gp2x testing
// Start: Saturday, July 12, 2008
// IDE Version: 5.322
SETTRANSPARENCY RGB(255,0,255)
LOADSPRITE "keyboard.bmp", 0
LOADFONT "smalfont.bmp", 0
SYSTEMPOINTER TRUE
DIM key3$[6][13]
//first row
LET key3$[1][1]="1"
LET key3$[1][2]="2"
LET key3$[1][3]="3"
LET key3$[1][4]="4"
LET key3$[1][5]="5"
LET key3$[1][6]="6"
LET key3$[1][7]="7"
LET key3$[1][8]="8"
LET key3$[1][9]="9"
LET key3$[1][10]="0"
LET key3$[1][11]="-"
LET key3$[1][12]="="
//second row
LET key3$[2][1]="q"
LET key3$[2][2]="w"
LET key3$[2][3]="e"
LET key3$[2][4]="r"
LET key3$[2][5]="t"
LET key3$[2][6]="y"
LET key3$[2][7]="u"
LET key3$[2][8]="i"
LET key3$[2][9]="o"
LET key3$[2][10]="p"
//LET key3$[2][11]="BACKSPACE"
//LET key3$[2][12]="BACKSPACE"
//third row
LET key3$[3][1]="CAPS"
LET key3$[3][2]="a"
LET key3$[3][3]="s"
LET key3$[3][4]="d"
LET key3$[3][5]="f"
LET key3$[3][6]="g"
LET key3$[3][7]="h"
LET key3$[3][8]="j"
LET key3$[3][9]="k"
LET key3$[3][10]="l"
LET key3$[3][11]="ENTER"
LET key3$[3][12]="ENTER"
//forth row
LET key3$[4][1]="SHIFT"
LET key3$[4][2]="z"
LET key3$[4][3]="x"
LET key3$[4][4]="c"
LET key3$[4][5]="v"
LET key3$[4][6]="b"
LET key3$[4][7]="n"
LET key3$[4][8]="m"
LET key3$[4][9]=","
LET key3$[4][10]="."
LET key3$[4][11]="/"
//fifth row
LET key3$[5][2]=";"
LET key3$[5][3]="`"
LET key3$[5][4]="'"
LET key3$[5][5]=" "
LET key3$[5][6]=" "
LET key3$[5][7]=" "
LET key3$[5][8]=" "
LET key3$[5][9]=" "
LET key3$[5][10]="["
LET key3$[5][11]="]"
LET key3$[5][12]="\\ "

LET GLOBAL text$="text:"

WHILE KEY(28)=FALSE
DRAWSPRITE 0,63,159
MOUSESTATE mx, my, b1, b2
IF b1
IF mousefree THEN keyboardclick(mx,my)
mousefree=FALSE
ELSE
mousefree=TRUE
    ENDIF
    PRINT text$,0,0
SHOWSCREEN
WEND



// ------------------------------------------------------------- //
// ---  KEYBOARDCLICK  ---
// ------------------------------------------------------------- //
FUNCTION keyboardclick: row, key2
LET row=INTEGER(my/16-9)
IF row=1 OR row=3 OR row=5
LET key2 = INTEGER(mx/16-3)
ELSEIF row=2 OR row=4
LET key2 = INTEGER((mx+8)/16-4)
ENDIF
IF key2<1 OR key2>12 OR row<1 OR row>5
row=0
key2=0
ENDIF
IF row=2 AND (key2=11 OR key2=12)
text$=MID$(text$,0,(LEN(text$)-1))
ELSE
text$=text$+key3$[row][key2]
ENDIF
ENDFUNCTION // KEYBOARDCLICK

a few questions
how could i make this cleaner?
what would be the best way for the return key?
also im getting a lot of warnings about variables:
"gp2x testing.gbas"(78) warning : probably unassigned variable : b2
"gp2x testing.gbas"(9) warning : implicitly created GLOBAL  : key3$

thank you
Yommy

Pages: [1]