Author Topic: sprite demo _ gdi plus question (figure)  (Read 4615 times)

0 Members and 1 Guest are viewing this topic.

Frankolinox

  • Guest
sprite demo _ gdi plus question (figure)
« on: May 07, 2014, 01:24:33 AM »
@peter :

Hi peter, I have a question how I can add the second figure, the nice boy  (..or another, perhpas a girly) in the "sprite" demo example (gdi plus folder).?
and perhpas there are some links for figures (as bitmap or png templates) do you can recommend? thanks for your sprite example.

best regards, frank

Mike Lobanovsky

  • Guest
Re: sprite demo _ gdi plus question (figure)
« Reply #1 on: May 07, 2014, 06:03:20 AM »
For bitmaps or tile sets, I found this:  http://www.reinerstilesets.de/de/2d-grafiken/

Thanks for sharing, Peter. A very good-looking and rich collection. :)

Frankolinox

  • Guest
Re: sprite demo _ gdi plus question (figure)
« Reply #2 on: May 07, 2014, 07:03:10 AM »
yes, I am meaning the sprite tiles demo thank you and for the link too :)

Frankolinox

  • Guest
Re: sprite demo _ gdi plus question (figure)
« Reply #3 on: May 08, 2014, 12:22:59 AM »
thanks peter for new example, I will check it this afternoon after work.

1) I noticed in my own test example "avengers" more than one alien is wandering through the scene. perhaps you can have a look at it, I am using the gdip.inc file from the gdiplus folder.

Code: [Select]
  include "gdip.inc"

Screen 640,480,1
SetCaption "Gdiplus TileSprite Demo_Frank"

sys font,fo,bild,stern,x,y,mouse
sys dir=1,x1,y1=480-64,zr=12,zl=8,zu=4,zd=0 '480-128
single r,v1,v2,v3,v4

font = LoadImage "png/afont.png",60
'bild = LoadImage "png/bild4.jpg",1
bild = LoadImage "png/avengersMovie.jpg",1
fo   = LoadImage "png/font16x.png",94
mouse= LoadTiles "png/bitmap.png",16,4

While Key(27)=0
'ClsColor 255,20,200,248
ZoomImage bild,0,0,640,480
'iText font,32,0,"HELLO IS A SDL DEMO"
'iText fo,32,32,"PRESS ESCAPE"
'iText fo,32,64,"FRAMES:" + ShowFps

iF dir=1
    drawTiles mouse,x1,y1,zr,0
    v1 +=.2
    iF v1 >=1
       v1=0
       inc zr
       iF zr=16 then zr=12
    End iF
    inc x1
    iF x1 >= 640-64 '128
       dir=2
       zr=12
    End iF
End iF   
iF dir=2
    DrawTiles mouse,x1,y1,zu,0
    v2 +=.2
    iF v2 >=1
       v2 =0
       inc zu
       iF zu=8 then zu=4
    End iF
    dec y1
    iF y1 <= 0
       dir=3
       zu=4
    End iF
End iF
iF dir=3
    DrawTiles mouse,x1,y1,zl,0
    v3 +=.2 
    iF v3 >=1
       v3=0
       inc zl
       iF zl=12 then zl=8
    End iF
    dec x1
    iF x1 <= 0
       dir=4
       zl=8
    End iF
End iF
iF dir=4
    DrawTiles mouse,x1,y1,zd,0
    v4 +=.2
    iF v4 >=1
       v4=0
       inc zd
       iF zd=4 then zd=0
    End iF
    inc y1
    iF y1 >= 480-64
       dir=1
       zd=0
    End iF
 End iF   

Flip
SetFps 40 '60'140
inc x
inc y
r += 0.5
iF r=360 Then r=-360
iF x=6 Then x=0
iF y=60 Then y=0
Wend
Ends

2) second question:
I tried to load a moving "gnome" (he's walking) with an image, do you have any idea how to make a sprite that is catching only one person of the moving row? see small picture below.

I attach my examples in zip folder with *.o2bas file and exe with images too.

thanks, frank

.

Frankolinox

  • Guest
Re: sprite demo _ gdi plus question (figure)
« Reply #4 on: May 09, 2014, 12:56:15 AM »
thank you peter for help :) your "banana" game example with girly is good. I like that one, but my skills aren't high enough yet to write my own little game at the moment, but for a learning study it's very good. my idea was to make something with a meadow and a cotton where somebody lives in and the door you can open and close and a wanderer (walking) boy they find new things on this way.

nice day, regards, frank