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.


Messages - ironwolfe

Pages: [1]
1
QB64 Discussion / loading a 256 color image
« on: April 12, 2019, 11:01:15 am »
I'm trying to load a 256 color picture into a 1289,720,256 screen but i keep getting "illegal function call" when i _putimage. I suspect its the picture itself, what is the best way to convert images to 256 colors so they are compatible with QB64.

here is a copy of the code.

DIM pic&

SCREEN _NEWIMAGE(1280, 720, 256)





temp


SUB temp


    pic& = _LOADIMAGE("demon.bmp")
    '_COPYPALETTE backgrnd1, 0
    _PUTIMAGE (3, 3), pic&



    SLEEP

END SUB



2
QB64 Discussion / Re: object detection in ascii based game
« on: April 11, 2019, 01:18:17 am »
changing background color to black seems to have corrected issue, i don't think this should affect my program as i only want to load images and text mostly, thanks for the help you have been very helpful.

3
QB64 Discussion / Re: object detection in ascii based game
« on: April 11, 2019, 12:32:26 am »
sorry i posted wrong file, here is proper one.


4
QB64 Discussion / Re: object detection in ascii based game
« on: April 11, 2019, 12:09:50 am »
here is a working code of my map in 32 bit .

i have attached file

5
QB64 Discussion / Re: object detection in ascii based game
« on: April 10, 2019, 11:15:45 pm »
i'm using this this code to move player on map.

    player.r = 4
    player.c = 72


    oldplayer.r = player.r
    oldplayer.c = player.c

    wall = "#"


    DO




        LOCATE player.r, player.c: COLOR playercolor: PRINT ; player



        DO

            k$ = INKEY$

        LOOP UNTIL k$ <> ""





        SELECT CASE k$
            CASE IS = "w"
                IF CHR$(SCREEN(player.r - 1, player.c)) <> wall THEN
                    oldplayer.r = player.r
                    oldplayer.c = player.c
                    player.r = player.r - 1
                    LOCATE oldplayer.r, oldplayer.c: PRINT " "
                END IF


            CASE IS = "s"
                IF CHR$(SCREEN(player.r + 1, player.c)) <> wall THEN
                    oldplayer.r = player.r
                    oldplayer.c = player.c
                    player.r = player.r + 1
                    LOCATE oldplayer.r, oldplayer.c: PRINT " "

                END IF

            CASE IS = "a"
                IF CHR$(SCREEN(player.r, player.c - 1)) <> wall THEN
                    oldplayer.r = player.r
                    oldplayer.c = player.c
                    player.c = player.c - 1
                    LOCATE oldplayer.r, oldplayer.c: PRINT " "

                END IF

            CASE IS = "d"
                IF CHR$(SCREEN(player.r, player.c + 1)) <> wall THEN
                    oldplayer.r = player.r
                    oldplayer.c = player.c
                    player.c = player.c + 1
                    LOCATE oldplayer.r, oldplayer.c: PRINT " "

                END IF

            CASE IS = "q"
                END



6
QB64 Discussion / Re: object detection in ascii based game
« on: April 10, 2019, 11:09:56 pm »
im just printing test strings using mid$  here is a sample of my code  im very new to this so i appreiciate the patience.

    mase(2, 1) = "###############################################################################################"
    mase(3, 1) = "#xxxxxx###       ########                                                                D    #"
    mase(4, 1) = "#xxxx   ###      ########    ######  #######################     ########  #########  #####   #"



i'm using this code to print out mase(43,1)  string array and change color of map character.

    shop = "V": shopcolor = _RGB(83, 105, 0)
    wall = "#": wallcolor = _RGB(133, 122, 0)
    home = "H": homecolor = _RGB(244, 89, 0)
    door = "D": doorcolor = _RGB(89, 61, 0)
    tree = "x": treecolor = _RGB(17, 177, 0)
    player = "P": playercolor = _RGB(216, 161, 0)

    DO

        FOR y = 2 TO 43
            FOR x = 1 TO 95

                'FOR i = 42 TO 95

                SELECT CASE MID$(mase(y, level), x, 1)

                    CASE shop
                        COLOR shopcolor
                    CASE wall
                        COLOR wallcolor
                    CASE home
                        COLOR homecolor
                    CASE door
                        COLOR doorcolor
                    CASE tree
                        COLOR treecolor
                    CASE player
                        COLOR playercolor

                END SELECT
                ' LOCATE 2, col(y)


                LOCATE y, 65 + x: PRINT MID$(mase(y, level), x, 1)



                'NEXT col

                ' NEXT i

            NEXT x
        NEXT y

    LOOP UNTIL y > 43






7
QB64 Discussion / Re: object detection in ascii based game
« on: April 10, 2019, 10:30:35 pm »
thanks for the reply the only reason i wanted to change the color was i cant seem to _putimage in 256 mode.

8
QB64 Discussion / Re: object detection in ascii based game
« on: April 10, 2019, 10:24:04 pm »
im using "select case",  with " if  then "statements to detect string variable "#" or my wall in map.,this works as mentioned when i change back 256 mode. i had to change color values to _rgb when drawing maze but other than that nothing else has changed.

9
QB64 Discussion / object detection in ascii based game
« on: April 10, 2019, 09:48:45 pm »
I'm a newcomer to QB64 and i'm trying to solve a problem with moving my player "P" around a text generated maze at 1280,720,32 and avoid hitting other objects. I have been able to get it all working in 1280,720,256 , but when i try to load it in 32 bit color i can still load map correctly and move player, but player no longer detects objects and passes right through them . If there is a fix for this problem it would be greatly appreciated.

Pages: [1]