Main Menu

Cool Gliding

Started by stef, December 04, 2005, 02:19:56 PM

Previous topic - Next topic

stef

Hi!

Just want to present one of my projects.

If there is any progress I will extend or change the code below.
But I don't know whether there is any (playable) outcome.

Feel free to post critics, suggestions,questions,etc...

Greetings
stef


cg1:
core of the program with raw concept!!. (I will use this program as platform for experiments).At latest consideration I will probably change the design (I mean the technical construction) of the racer to a "super high tech" vehicle.

cg2:
several changings in code
new draft of the vehicle; instead of a sail it's only a wing-shaped mast

cg3:
some motion-tests; read raw concept-text

cg4:
first motion demo, (some errors, like rotating in standing)


; PROJECT : cg4
; AUTHOR  : stef
; CREATED : 08.12.2005
; EDITED  : 11.12.2005
; ---------------------------------------------------------------------
; ---------------------------------------------------------------------
OpenScreen 800,600,16,2
;SetFPS

LoadFont "arial",2,40,3
MakeShadowBitmapFont 2,RGB(240,0,0),1,0,RGB(5,5,205)
LoadFont "arial",3,16,1
MakeShadowBitmapFont 3,RGB(110,230,240),1,1,RGB(100,100,100)
LoadFont "arial",4,16,1
MakeBitmapFont  4,RGB(0,0,240)

Gosub titlescreendraw
; creates the titlescreen (imageimage) - of course you can load an image (or draw a better one)
Gosub buttondraw
; creates the buttons that are placed on titlescreen - for "startgame", "settings", etc.
Gosub mousedraw
; creates a mousepointer
SetFont 3

Gosub demoimagedraw

Gosub mainloop


;-----------------------------------------mainloopstart
mainloop:

Do

RenderToScreen
Cls 0

DrawImage titleimage , 200,150,1
For b = 1 To 7
DrawImage button1, 230,200+b*22,1
Next
SetFont 3
Text 260,203+1*22,"DEMO 1"
;Text 260,203+2*22,""
;Text 260,203+3*22,""
;Text 260,203+4*22,""
Text 260,203+5*22,"RAW CONCEPT - TEXT"
Text 260,203+6*22,""
Text 260,203+7*22,"QUIT"


For button=1 To 7
If PointIntersectCircle(MouseX(), MouseY(), 240, 210+button*22, 8)
CircleC 240,210+button*22,8,1,RGB(250,5,5)
If LeftMouseButton()=True Then number = button
FlushMouse
Select number
Case 1
 Cls 0
 Gosub demo1
  FlushMouse
Case 5
 Cls 0
  Gosub concepttext
 FlushMouse
 Case 7
  End
 Default
 
EndSelect
FlushMouse

EndIf
Next



DrawImage mouse1, MouseX(),MouseY(),1

Sync

If EscKey()=True Then End

Loop


;----------------------------------------------mainloopend

titlescreendraw:
;...-----------------------------------------titlescreenimage
skid=GetFreeImage()
CreateImage skid, 30,6
RenderToImage skid
EllipseC 14,0,14,6,1,RGB(100,100,100)
BoxC 14,0,30,6,1,RGB(100,100,100)

titleracer=GetFreeImage()
CreateImage titleracer, 240,220
RenderToImage titleracer

For x= 1 To 2
LineC 129+x,214,129+x,12,RGB(100+x*20,100+x*20,100+x*20)
LineC 131+x,214,131+x,12,RGB(200-x*20,200-x*20,200-x*20)

Next

EllipseC 160,220,140,12,1,RGB(250,200,0)
BoxC 22,218,240,220,1,RGB(250,100,0)

CircleC 170,210,5,1,RGB(50,50,250)
CircleC 175,210,6,1,RGB(0,0,0)


titleimage=GetFreeImage()
CreateImage titleimage, 400,300
RenderToImage titleimage

For x =0 To 10
BoxC 0+x,0+x,400-x,300-x,1,RGB(40*x,40*x,40*x);frame
Next x
GouraudQuad 10, 10, RGB(0,20,240), 10, 290, RGB(230,30,230), 390, 290, RGB(230,30,230), 390, 10, RGB(0,20,240)
BoxC 10,230,390,290,1,RGB(110,230,240)

DrawImage titleracer ,100,40,1
DrawImage skid, 130,263,1
DrawImage skid, 280,264,1

BoxC 146,260,150,264,1,RGB(200,0,0)
BoxC 285,258,306,264,1,RGB(250,0,0)

SetFont 2
Text 20,20,"COOL GLIDING"

DeleteImage titleracer
DeleteImage skid

Return

buttondraw:
;----------------------------------------------------buttondraw
button1=GetFreeImage()
CreateImage button1, 20,20
RenderToImage button1
CircleC 10,10,10,1,RGB(100,100,100)
CircleC 10,10,8,1,RGB(200,5,5)
Return

mousedraw:
;---------------------------------------------------mousedraw
mouse1=GetFreeImage()
CreateImage mouse1, 24,24
RenderToImage mouse1
BoxC 0,0,24,24,1, RGB(250,100,0)
BoxC 2,2,24,24,1, RGB(250,250,250)
TriC 2,2,2,24,24,24,RGB(150,150,150)
QuadC 2,24,24,24,24,2,8,8,RGB(0,0,0)
Return

concepttext:
;----------------------------------------------------concepttext
RenderToScreen
Cls 0
Print "--------COOL GLIDING-----------"
Print ""
Print "Game - ice sailing - simulation/funracer - scrolling tile map - view from above"
Print "ice sailing on frozen seas or rivers in reality is very fast, velocity is up to a maximum of 200 km/h "
Print "modern iceracer-vehicles are normally built with 3 skids. the skid in the front/nose is for steering."
Print "maximum speed will be reached with wind from aside (not from the back)"
Print "In game you will need skill for steering along a  course or to avoid obstacles"
Print "Steering probably with mouse:"
Print "move mouse to left or right: the racer will go that way"
Print "move mouse back: the sail will pull to middle position"
Print "move mouse forward: will release the sail (into the wind)"
Print ""
Print "thinkable natural obstacles/tiles on tilemap:"
Print "islands, rocks,reed,perfect ice (very fast), bad ice (slow),water on ice, snow on ice,ice floe, etc..."
Print ""
Print "maybe races against time or other ice-racers(computer-ai)"
Print "could be more realistic (like a simulation) or more like a funracer with unrealistic effects or maneuvers"
Print "like using a ice floe as ramp, and jump over an obstacle."
Print "cg2:"
Print "new draft of vehicle; instead of sail:a mast shaped like a wing"
Print "cg3:"
Print "several motion-tests; base idea to this: if the vehicle is moving the map should scroll and rotate under the"
Print "vehicle,that is always at the same place, to do this, it would be necessary to draw the (tile)map, grab the part around"
Print "the vehicle and rotate that part of the map (don't know whether this will work in game_reality)"
Print "test1: simple rotate a image 1600X1600; isn't fast,also jerkily "
Print "test2: 4 images(600x600,all the same) are arranged; in the cross in the middle is the vehicle; "
Print "test3: 4 different images grabbed from a 1200X1200 image, tech as above"
Print "test4: 2 different images, turning point at the edges"
Print "test 3 runs on my comp with about fps 160"
Print "the 'ice' is not ready, but in raw concept-image is a little 'glittereffect'"
Print "cg4:"
Print "motion demo; map is fix (no rotating map,doesn't really work); in demo endless scrolling map"
Print "several compasses ( one is only digital)"


Sync
WaitKey
number=0
Return

demoimagedraw:
;-------------------------------------------demoimagedraw
;----------------------------------------------ice
ice1=GetFreeImage()
CreateImage ice1 , 100,100
RenderToImage ice1
BoxC 0,0,100,100,1,RGB(120,70,240)
For x=1 To 20000
plx=RndRange(0,100)
ply=RndRange(-10,100)
extx=1
exty=RndRange(1,12)
BoxC plx ,ply,plx+extx,ply+exty,1,RGB(120,70,RndRange(230,250))
Next
BlurImage ice1, 8
ice1a=GetFreeImage()
CreateImage ice1a , 800,600
RenderToImage ice1a
TileImage ice1,0,0,1

windflyer1=GetFreeImage()
CreateImage windflyer1,120,140
RenderToImage windflyer1

BoxC 4,90,6,114,1,RGB(100,100,100);skid
BoxC 114,90,116,114,1,RGB(100,100,100)

BoxC 40,21,80,30,1,RGB(250,200,0);frontspoiler
BoxC 40,20,80,30,0,RGB(200,0,0)
BoxC 40,21,80,22,1,RGB(250,50,0)

BoxC 44,26,76,30,1,RGB(250,0,0)

BoxC 0,94,120,110,1,RGB(250,100,0);wings
BoxC 2,97,118,108,1,RGB(250,200,0)
BoxC 10,104,110,110,1,RGB(250,0,0)
BoxC 0,94,120,110,0,RGB(200,0,0)

SetFont 4
Text 8, 92, "WINDY"
Text 70, 92, "FLYER"

EllipseC 60,70,7,70,1,RGB(250,50,0)

EllipseC 60,70,5,65,1,RGB(250,100,0)
EllipseC 60,70,4,60,1,RGB(250,150,0)
EllipseC 60,70,3,58,1,RGB(250,200,0)

EllipseC 60,86,5,8,1,RGB(50,50,50)
EllipseC 60,82,5,4,1,RGB(50,50,250)
EllipseC 60,70,7,70,0,RGB(200,0,0)

CircleC 60,70,4,1,RGB(200,200,200);mast
CircleC 60,70,4,0,RGB(100,100,100)
For m =1 To 7
LineC 60,67+m,90,74,RGB(200-m*10,200-m*10,200-m*10)
Next

LineC 0,94,60,70,RGB(200,200,200);ropes
LineC 120,94,60,70,RGB(200,200,200)
LineC 40,30,60,70,RGB(200,200,200);ropes
LineC 80,30,60,70,RGB(200,200,200)
LineC 40,30,0,94,RGB(200,200,200);ropes
LineC 80,30,120,94,RGB(200,200,200)

shad1 = GetFreeImage();--------------------------------shadow
CopyImage windflyer1,shad1
FadeImage  shad1, 20
PrepareFXImage shad1
shad1sp=GetFreeSprite()
CreateSprite shad1sp
AutoCenterSpriteHandle shad1sp,True
SpriteImage shad1sp,shad1
SpriteDrawMode shad1sp,2

PrepareFXImage windflyer1
windflyer1sp=GetFreeSprite()
CreateSprite windflyer1sp
AutoCenterSpriteHandle windflyer1sp,True

SpriteImage windflyer1sp,windflyer1
SpriteDrawMode windflyer1sp,2

ScaleSprite windflyer1sp,1

;-------------------------------------------------round compass com1
com1=GetFreeImage()
CreateImage com1 , 140,140
RenderToImage com1
SetFont 3

For ang# = 0 To 360 Step 15
LineC 70,70,70+(Cos(ang#)*40),70+(Sin(ang#)*40),RGB(150,150,250)
Next
For ang# = 0 To 360 Step 45
LineC 70,70,70+(Cos(ang#)*50),70+(Sin(ang#)*50),RGB(250,100,100)
Next

CircleC 70,70,30,1,RGB(0,0,0)
l=1
For x = 1 To 9
l=l+5
LineC 61+x,90,61+x,90-l,RGB(250,0,0)
LineC 79-x,90,79-x,90-l,RGB(250,0,0)
LineC 61+x,90,61+x,90-l/5,RGB(0,0,0)
LineC 79-x,90,79-x,90-l/5,RGB(0,0,0)
Next

Text 66,12,"N"
Text 12,63,"W"
Text 118,63,"E"
Text 66,114,"S"

PrepareFXImage com1
com1sp=GetFreeSprite()
CreateSprite com1sp
AutoCenterSpriteHandle com1sp,True

SpriteImage com1sp,com1
SpriteDrawMode com1sp,2

com1frame=GetFreeImage()
CreateImage com1frame , 140,140
RenderToImage com1frame
For x=1 To 3
CircleC 70,70,65+x,0,RGB(250-40*x,200-40*x,200-40*x)
CircleC 70,70,66-x,0,RGB(250-40*x,200-40*x,200-40*x)
Next

;--------------------------------------------flat compass com2
com2=GetFreeImage()
CreateImage com2 , 480,80
RenderToImage com2
For x = 0 To 480 Step 5
LineC x,10,x,20,RGB(100,100,100)

Next

For x = 0 To 480 Step 30
x1=x
LineC x,10,x,25,RGB(250,100,100)
x1=x1-60
If x1 = 360 Then x1 = 0
If x1 =-30 Then x1=330
If x1=390 Then x1=30
If x1=420 Then x1=60

CenterText x,30,x1
Next
;For x = 0 To 480 Step 45
; LineC x+60,5,x+60,20,RGB(250,50,50)
;Next

com2frame = GetFreeImage()
CreateImage com2frame,132,60
RenderToImage com2frame
LineC 132/2,0,132/2,60,RGB(250,0,0)
For x=1 To 3
BoxC 3-x,3-x,129+x,57+x,0,RGB(250-40*x,200-40*x,200-40*x)
BoxC 2+x,2+x,130-x,58-x,0,RGB(250-40*x,200-40*x,200-40*x)
Next
;-----------------------------------------------------------com3
com3=GetFreeImage()
CreateImage com3 , 140,140
RenderToImage com3
l=3
For x = 1 To 9

l=l+6
LineC 61+x,70,61+x,70-l,RGB(250,0,0)
LineC 79-x,70,79-x,70-l,RGB(250,0,0)
LineC 61+x,70,61+x,70+l,RGB(70,70,70)
LineC 79-x,70,79-x,70+l,RGB(70,70,70)
Next
Text 66, 50,"N"

PrepareFXImage com3
com3sp=GetFreeSprite()
CreateSprite com3sp
AutoCenterSpriteHandle com3sp,True

SpriteImage com3sp,com3
SpriteDrawMode com3sp,2


com2a=GetFreeImage()

Return

demo1:
;------------------------------------------------------------------demo1
speed#= 0.0
angle# =0.0

Do
RenderToImage com2
angle=angle#
GetImage com2a,angle,0,angle+120,60


RenderToScreen
Cls 0

DrawImage ice1a,0,0,1
ScrollImage ice1a,(Sin(-angle#)*speed),(Cos(-angle#)*speed)

If speed# > 0
glitterx = RndRange(0,800)
glittery = RndRange(0,600)
CircleC glitterx,glittery,3,1,RGB(250,250,250)
EndIf

RotateSprite shad1sp,angle#
PositionSprite shad1sp, 396,404
DrawSprite shad1sp

RotateSprite windflyer1sp,angle#
PositionSprite windflyer1sp, 400,400
DrawSprite windflyer1sp

RotateSprite com1sp, -angle#
PositionSprite com1sp, 700,100
DrawSprite com1sp
DrawImage com1frame ,630,30,1

DrawImage com2a,640,200,1
DrawImage com2frame,634,194,1

RotateSprite com3sp, -angle#
PositionSprite com3sp, 700,320
DrawSprite com3sp



SetFont 2
Text 640,400,"DEG: "+Str$(angle)
Text 660,400,Chr$(176)
Text 600,540,"FPS: "+ Str$(FPS())
Text 600,500,"SPEED:"+Str$(speed)
SetFont 3
Inc blink
If blink >100
Text 0,580," Use arrow-keys  -    hit Space to return"
If blink =200 Then blink=0

EndIf
Sync

If UpKey()  Then speed# = speed# + 0.01
If DownKey() Then speed# = speed# - 0.01
If LeftKey()  Then angle# = angle# - 0.5
If RightKey() Then angle# = angle# + 0.5


If speed#>2 Then speed#=2.0
If speed#<0 Then speed#=0
ypos#=ypos#+speed#
speed= speed#*10.0

If angle# >360 Then angle#=0
If angle# < 0 Then angle#=360

If SpaceKey() = True Then ExitDo

Loop
number=0
Return


stef

Hi
Made several changes, new draft of vehicle

stef

#2
Hi

added motion-tests (rotation)
read raw concept-text

tomazmb

Hello,

It's a nice demo so far. I hope you will continue. It will be interesting to see, how will your project look like when it will be finished.

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c

stef

Hi!

@Tomaz
Thanks for comment.

Made a first demo ( more a "pre demo")
with several compasses ( this is just for safety!!! :rolleyes: )

Greetings
stef

tomazmb

Hello,

It's stunning what can be made out of lines and boxes. I like compasses very much. Well done Stef (Nur weiter so, Stef).

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c