Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 problem with soccer game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Learn it




PostPosted: Mon Jun 20, 2005 12:16 am   Post subject: problem with soccer game

i have a proble with making a soccer game, can some body help me?
thank u in advance...heres what i have so far
code:
var y : int
var a : int
var b : int
var y2, y1 : int
var chars : array char of boolean
var rx : real
var ry : real
var move : int
var playq : int
var p1, p2 : int
var s : int % Score
var C : int
var x2 : int :=1
var val:int
var num:int

x2:=200
y:=200
a:= +1
b:= -1
y1:=230
y2:=230
x2:=390
move:=1
playq:=1
p1:=0
p2:=0
s:=4
C:=2
num:=1
%players
loop
%playq

%===================================================
val:=PC.ParallelGet(1)
drawfillbox (0, y2,30, y2 - 60, brightred)
delay(5)
drawfillbox (0, y2, 30, y2 - 60, white)
if(val div 32) mod 2=0 and move=1 then
y2 := y2 + 1
x2:=x2+1
elsif (val div 16) mod 2=0 and move=1 then
y2 := y2 - 1


end if
if (y2 <= 65) then
y2 := y2 + 1
elsif (y2 >= 395) then
y2 := y2 - 1
end if
%===================

if(val div 64) mod 2=0 and move=1 then
x2 := x2 + 1
elsif (val div 32) mod 2=0 and move=1 then
x2 := x2 - 1
end if
if (x2 <= 65) then
x2 := x2 + 1
elsif (1>= 395) then
x2 := x2 - 1
end if
%========================================
if playq = 1 then
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) and move = 1 then
y1 := y1 + 1
elsif chars (KEY_DOWN_ARROW) and move = 1 then
y1 := y1 - 1
end if
if (y1 <= 65) then
y1 := y1 + 1
elsif (y1 >= 395) then
y1 := y1 - 1
end if
drawfillbox (822, y1, 600, y1 - 60, blue)
delay(5)
drawfillbox (822, y1, 600, y1 - 60, white)
end if

%============================================================


end loop
Sponsor
Sponsor
Sponsor
sponsor
chocho tete




PostPosted: Mon Jun 20, 2005 9:04 am   Post subject: (No subject)

THATS NOT SOCCER THATS PONG!!!
ssr




PostPosted: Mon Jun 20, 2005 4:16 pm   Post subject: (No subject)

whats ur problem? what kind of game do u want t o make?
be more specific Very Happy
Learn it




PostPosted: Wed Jun 22, 2005 1:24 pm   Post subject: (No subject)

ok if this can help u i added more things on it but i cant still make the 2 players move through the field...to make them move i want to use the arrows on the keybord

UP arrow moves plyer1 up down arrow moves plyer1 down and left arrow , right arrow


for the second player i want to use bradbord(switch) but i dont know how to make it

heres how i want to use it tho

The switch to go up is pin 13

The switch to go down is pin 12

The switch to go right is pin 11

The switch to go left is pin 10

The switch to shoot pin 15



[/code]



% builds the field.
drawfillbox (0,0,maxx,maxy,green)
drawbox (1,5,maxx,maxy,white)
drawfillbox (0,125,30,290,gray)
drawfillbox (600,110,650,290,gray)
drawbox (0,0,maxx,maxy,2)
drawline (300,150,300,0,white)
drawline (300,395,300,260,white)
drawoval(300,205,50,10,white)

%players


drawfillbox (90,260,110,210,gray)
drawfillbox (510,260,530,210,gray)

%ball moving

loop
for t: 1 .. 3
for x: 10..630
drawfilloval (x,40,10,10,brightred)
delay (5)
drawoval (x,40,10,10,green)
end for
for decreasing x: 630..10
drawfilloval (x,40,10,10,brightred)
delay (5)
drawfilloval (x,40,10,10,green)
end for
end for
end loop

code:


thank u  :D
vagyb




PostPosted: Wed Jun 22, 2005 5:17 pm   Post subject: (No subject)

well i'm not expert or anything in turing but i'm guessing it would be easier if u imported the paddles from a picture file, this way the movements will be easier.
here is an example
var chars : array char of boolean
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
shipY += 8
elsif chars (KEY_DOWN_ARROW) then
shipY -= 8
end if
jamonathin




PostPosted: Thu Jun 23, 2005 10:13 pm   Post subject: (No subject)

vagyb wrote:
well i'm not expert or anything in turing but i'm guessing it would be easier if u imported the paddles from a picture file, this way the movements will be easier.
here is an example
var chars : array char of boolean
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
shipY += 8
elsif chars (KEY_DOWN_ARROW) then
shipY -= 8
end if

In which way would it make it easier? Yes it would make the program look better, and it would be cool if he did that, considering hes going through the trouble of using a joystick, but easier . . . Confused
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: