News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

BOTS - Brotherhood Of The Solarbeetles

Started by stef, July 09, 2006, 07:16:47 AM

Previous topic - Next topic

stef

#15
Hi!

In this example you can see what happen if you write programs without discipline and structure.
It could cause terribly crashes! :)

So I recognized that I must develope  programs with more structure.

Note!
From tomorow  on I am on vacation for some days (without internet)

But I plan to write a small game demo (working title "BOTS 3T")


Greetings
stef

[attachmentid=710]

PlayBASIC Code: [Select]
; PROJECT : bots4
; AUTHOR : stef
; CREATED : 14.07.2006
; EDITED : 16.07.2006
; ---------------------------------------------------------------------

;made with PB V1.44

Global sw=800
Global sh=600
LoadFont "comic sans ms",2,150,1
global backim
;OpenScreen 800,600,32,2
;ScreenVsync On
SetFPS 50

Global grey30= RGB(30,30,30)
Global grey60= RGB(60,60,60)
Global grey90= RGB(90,90,90)
Global grey120= RGB(120,120,120)

Global bs=50
Global lh=400;levelheight
Global factor=1
Global a#
Global f#

;Global ind
Global number=23;bots= number+1
global ind1
Global backgroundim
global ang#
Type theadcol
col
EndType

Type thead
headcol As theadcol
EndType

Dim head(5) As thead

Type tparts
leg
joint
foot
EndType

Dim part As tparts



Type position
x,y
EndType

Type tbots
image
sp
legang#
factor
imx,imy
botpos As position
pos1 As position
leg1_angle#
leg1_factor
f1#
pos2 As position
leg2_angle#
leg2_factor
f2#
pos3 As position
leg3_angle#
leg3_factor
f3#
height
EndType


Dim bot(number) As tbots

Global bot

background()
partsdrawing()

Global ind

For ind= 0 To number
bot(ind).imx=3*bs
bot(ind).imy=3*bs

bot(ind).pos1.x=bot(ind).imx/2+10
bot(ind).pos1.y=bot(ind).imy/2+4
bot(ind).pos2.x=bot(ind).imx/2
bot(ind).pos2.y=bot(ind).imy/2+4
bot(ind).pos3.x=bot(ind).imx/2-10
bot(ind).pos3.y=bot(ind).imy/2+4
bot(ind).leg1_factor=1
bot(ind).leg2_factor=-1
bot(ind).leg3_factor=1
bot(ind).botpos.x=78
bot(ind).botpos.y=sh
Next
;----------------------------------------------------------------loop
Do

botcalc()


RenderToScreen
Cls 0

DrawImage backim,0,0,0

DrawAllSprites
Sync

DeleteALLSprites
Loop
WaitKey
;----------------------------------------------------------------------

Function botcalc()



For ind = 0 To number


if bot(ind).botpos.x=78
bot(ind).botpos.y=bot(ind).botpos.y-2

If bot(ind).botpos.y<=(-5-ind)*100
bot(ind).botpos.x=520

endif
endif

if bot(ind).botpos.x>=520
bot(ind).botpos.y=bot(ind).botpos.y+2


If bot(ind).botpos.y>=322-100*ind
bot(ind).botpos.x=bot(ind).botpos.x+rnd(3)

endif

If bot(ind).botpos.y>=sh+200-(ind*100)
Login required to view complete source code



Fash

The bots are cool and definately need their own game...very nintendoish :D
Well done
For PC game/demo music visit
Future Developments

stef

Hi!

Only one known bug remaining and it's finished :)  

This is the BOTS Minigame Tic Tac Toe (use only mouse)

The lasers are made with the brandnew "fat lines" :)

Greetings
stef

kevin

The forums upload ability is broken.  Meaning users can't download attachments.

empty

Or to be more precise, at the moment, the only way to download an attachment is to right-click on it and choose "Save Link As" (or whatever it's called in IE) and then change the file extension (to .zip in this case).

stef

#20
Hi!

Sorry! I forgot.
(But maybe someone can fix/repair this problem.)

Here is the code: (not optimized,unstructered)

PlayBASIC Code: [Select]
; PROJECT : BOTS - TIC TAC TOE
; AUTHOR : stef
; CREATED : 24.07.2006
; EDITED : 05.08.2006
; ---------------------------------------------------------------------
Randomize Timer()

Global sw=800
Global sh=600
Global levelh=500

LoadFont "comic sans ms",2,30,1
LoadFont "comic sans ms",3,48,1

SetFont 2

;OpenScreen sw,sh,32,2
;ScreenVsync On
SetFPS 60

Global grey30= RGB(30,30,30)
Global grey60= RGB(60,60,60)
Global grey90= RGB(90,90,90)
Global grey120= RGB(120,120,120)
Global grey150= RGB(150,150,150)
Global grey180= RGB(180,180,180)

Dim field(8)
Dim checksum(7)
Dim rowpos(2)
Dim fieldim(8)
Global fieldim
Dim copyoffieldim(8)

Global backgroundim
Global cross
Global nought
Global newgameim
Global buttonim
Global winlaser
Global elevator

Global finish

Global winmove
Global defmove
Global movenumber
Global winstatus=0
Global gamestatus=0
Global player =1
Global first=1
Global nextcount

Global goflag
Global laserflag

Global blflag
Global nextturn
Global aim = 1000

Global message$
Global ready
Global count

Global winx,defx
Global iwin,youwin,drawwin

Global bs=50
Constant number=0

Global ind

Global myangle#;o
Global xstart=130;x
Global ystart=75;x
Global xstart2=130;x
Global count2;x

Global xpos,ypos

Global f#=1
Global fact#=0.2
Global eyecounter

Type theadcol
col
EndType

Type thead
headcol As theadcol
EndType

Dim head(5) As thead

Type tparts
leg
joint
foot
ray
eye
closeeye
botlaser
userlaser
signim
EndType

Dim part As tparts


Type position
x#,y#
EndType

;----------------------------------------------tbots
Type tbots
image
imagecopy
imw,imh
imfactor;imagesize:imfactor*bs
imcenterx,imcentery;center of image
sp

masterpos As position;pos of sprite
masterangle#
masterdirection
masterstatus

headpos As position
headangle#
headdirection
headim
headimcopy

eyex#

legxfactor
legyfactor

walkerfactor
walkerleg
walkerstatus
turnstatus

laserstatus

leganglechange

pos1 As position
leg1length#
Login required to view complete source code


Big C.

very beautiful demo... The animations of your bot are very cool... I think that all drawings are handmade, right?



empty


stef

Hi!

Thx for replies!

The drawings are generated by the code/formulas (not really handmade or predrawn  :) )

At this time I think the impression should be a little bit more "weird". like a synthesis of cubism and surrealism.  :)

Just working on 2 other demos
The first is "4 in a row".(this game is similar to tictactoe, but with different  animations and gamestyle)
the other one is something with a "flyertype" (looking like a helicopter)


Greetings
stef

Big C.

Quote4 in a row
If I play around with your demo my first thought was 4 in a row or 4 wins would be a better gameplay...

What would you mean about a Jump n Run demo Bots Land which would have a game play like mario land... ?

stef

#25
Hi!

At this time the maindirection of "BOTS-Development" isn't a jump and run game.
(But who knows what the future will bring? :) )

All I can offer is a "jump and fly" pre-demo :)  :

PlayBASIC Code: [Select]
; PROJECT : f2
; AUTHOR : stef
; CREATED : 09.07.2006
; EDITED : 06.08.2006
; ---------------------------------------------------------------------


Randomize Timer()
;made with PB V1.44

Global sw=800
Global sh=600

;OpenScreen 800,600,32,2
;ScreenVsync On
SetFPS 50

Global grey30= RGB(30,30,30)
Global grey60= RGB(60,60,60)
Global grey90= RGB(90,90,90)
Global grey120= RGB(120,120,120)
Global grey150= RGB(150,150,150)
Global grey180= RGB(180,180,180)

Global bs=50
Global lh=400;levelheight
Global factor=1
Global a#
Global f#
Global r1#=0
Global k

Global number=9;bots= number+1

Global backgroundim

Type theadcol
col
EndType

Type thead
headcol As theadcol
EndType

Dim head(5) As thead

Type tparts
leg
joint
foot
rotator
EndType

Dim part As tparts



Type position
x,y
EndType

Type tbots
image
sp
legang#
factor
imx,imy
botpos As position
pos1 As position
leg1_angle#
leg1_factor
f1#
pos2 As position
leg2_angle#
leg2_factor
f2#
pos3 As position
leg3_angle#
leg3_factor
f3#
rot#
height
flighty
EndType


Dim bot(number) As tbots

Global bot

background()
partsdrawing()

Global ind

For ind= 0 To number
bot(ind).imx=3*bs
bot(ind).imy=3*bs

bot(ind).pos1.x=bot(ind).imx/2+10
bot(ind).pos1.y=bot(ind).imy/2+4
bot(ind).pos2.x=bot(ind).imx/2
bot(ind).pos2.y=bot(ind).imy/2+4
bot(ind).pos3.x=bot(ind).imx/2-10
bot(ind).pos3.y=bot(ind).imy/2+4
bot(ind).leg1_factor=1
bot(ind).leg2_factor=-1
bot(ind).leg3_factor=1
;bot(ind).rot#=0

bot(ind).botpos.y=500-Rnd(100)
bot(ind).flighty=1
Next
;----------------------------------------------------------------loop
Do

botcalc()


RenderToScreen
Cls 0

DrawImage backgroundim,0,0,0


DrawAllSprites

Sync

DeleteALLSprites
Loop
WaitKey
;----------------------------------------------------------------------

Function botcalc()



For ind = 0 To number

k=Rnd(3)

If bot(ind).botpos.y<=200 Then bot(ind).flighty=1
If bot(ind).botpos.y>=450-20 Then bot(ind).flighty=-1

bot(ind).botpos.y=bot(ind).botpos.y+(k*bot(ind).flighty)

bot(ind).botpos.x=bot(ind).botpos.x+2
Login required to view complete source code


Ian Price

They don't stop being cute, do they.

Nice work :)
I came. I saw. I played some Nintendo.

stef

Hi!

This is the first working sketch of "BOTS - Jump and fly" :)
(This post is also a test of the new forum software)

There are no instructions or messages in the demo

In demo you can switch the cameraposition with -SPACEKEY-
Camera is either free ( you can move around with mouse) or it is focussed on the bot

with -rightmousebutton- the bot will raise
with -leftmousebutton- you can plant some algas :)

Greetings
stef


hatonastick

Wow Stef, you are a coding machine. :)  Love the bugs!  My favourite is actually the Tic-Tac-Toe. :)
Matthew 5:14-16