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

Username:   Password: 
 RegisterRegister   
 Turing Game Collision Help
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Zainabh




PostPosted: Mon Jun 06, 2016 4:33 pm   Post subject: Turing Game Collision Help

Helloo
Me and my friend are making a Turing game (kinda like flappy bird but modified) and are having trouble with collision detection with sprites
I have tried making equations but they don't work
Any help would be helpful



%******************************************************************************
%* FINAL PROJECT GAME *
%* SWIMMY FISH *
%* *
%* BY: ALEFIYAH DEAN & ZAINAB BHIMANI *
%* *
%* MAIN GAME *
%* This program displays the main game *
%******************************************************************************

setscreen ("graphics:800;600")

%Declare Variables
var picFish : int
var picBack : int
var spriteFish : int
var fish : array char of boolean
var x : int := 0
var y : int := 250
var up : int := 5
var distanceBottom : real
var picBottom : int
var down : int := 550


%Create The Fish (Swimmy Fish)
picBack := Pic.FileNew ("backgroundsea.bmp")
picBack := Pic.Scale (picBack, 800, 600)
Pic.Draw (picBack, 0, 0, picMerge)
picBottom := Pic.FileNew ("bottom.jpg")
picBottom := Pic.Scale (picBottom, 800, 2)
Pic.Draw (picBottom, 0, 0, picMerge)
picFish := Pic.FileNew ("fish.jpg")
picFish := Pic.Scale (picFish, 125, 125)
spriteFish := Sprite.New (picFish)
Sprite.Show (spriteFish)

include "pillarsdean.t"
loop
%For loop moves the sprite up and down the screen
loop
down := down - 10
delay (65)
Sprite.SetPosition (spriteFish, 150, down, true)

%Gets the fish to move up 5 spaces when the "UP ARROW" is pressed
Input.KeyDown (fish)
if fish (KEY_UP_ARROW) then
down += 50
Sprite.Show (spriteFish)
exit
end if
end loop

end loop
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: