Author |
Message |
Brandon FS
|
Posted: Thu Jun 21, 2012 9:49 am Post subject: I need some guidance |
|
|
What is it you are trying to achieve?
I am trying to create a simple Turing game where you can move around an object that fires at an AI while the AI fires at the object/user. the user and the AI player should take turns shooting. The bullets should ricochet off of the sides of the map.>
What is the problem you are having?
I am unfamilair with the Turing Language and I would like it if someone could provide a basic set of code that I can adapt(replacing the background, incorporating sounds into the game, changing the skin for each player. Keep in mind I am only asking for basic code, nothing far fetched. Thank you.
Describe what you have tried to solve this problem
<Answer Here>
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Raknarg
|
Posted: Thu Jun 21, 2012 1:08 pm Post subject: RE:I need some guidance |
|
|
You're going to have a hard time getting people to do any actual programming for you here, we advocate creating things yourself. You learn more. |
|
|
|
|
|
Zren
|
Posted: Thu Jun 21, 2012 1:28 pm Post subject: RE:I need some guidance |
|
|
> I am trying to create a simple Turing game
If this is your first project, then a particle engine is probably not a simple game.
> where you can move around an object that fires at an AI while the AI fires at the object/user.
Change that to 2 Players, and you might be able to pull this off. Writing a good AI is a project all on it's own.
Moving an object around the screen can be found in the Turing Turorial forum.
http://compsci.ca/v3/viewforum.php?f=3
> the user and the AI player should take turns shooting.
Use a variable to store which players turn it is. When you reach the last player's turn, wrap around to the first player.
You should first try to design this with an unknown amount of players (2 or more). But only if you've learnt arrays.
> The bullets should ricochet off of the sides of the map.
Look for a Particle Engine. A custom one where each particle either stores the distance it's travelled or the number of collisions it's had, so that the particle will stop moving. If you don't do that, it will bounce forever.
> unfamilair with the Turing Language
The Turing Walkthrough is a fairly good primer if you're jumping from another language. |
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 1:31 pm Post subject: Re: I need some guidance |
|
|
Thank you for the replies, Ie deicided to try and program a different game. But my game does not seem to be working, If one of you guys could tell me where I went wrong and how i can get my program running I would appreciate it. Thank you.
Here is the Code:
Turing: |
%I do not own any of the backgrounds or sprites used to make the program
setscreen ("graphics : 400;300,offscreenonly")
color (white)
color (black)
View.Update
var map : array 1 .. 2 of int %Makes it so that a numeral will represent
%the map (easier coding)
map (1) := Pic.FileNew ("Map1.jpg")%Incorpirating the first map
map (2) := Pic.FileNew ("Plains.jpg")%Incorporating the second map
var char1 : int := Pic.FileNew ("8bitspartan.JPG")
var chars : array char of boolean%allows me to use the keyboard
var posx, posy : int%characters position/velocity
posx := 50
posy := 50
var velx, vely : int
velx := 0
vely := 0
var HP : int%Player HP (Health Points)
var FHP : int%Full HP or health Limit)
HP := 100
FHP := 150
var grav : int := 10 %Gravity(acceleration of gravity/the speed at which velocity changes)
var damage : int := 15
const JS : int := 90 %Jump Speed
proc Movement
%Coding that enables the Jump feature
if chars (KEY_UP_ARROW) and posy < maxy - 30 and whatdotcolor (posx + 10,posy - 10) = black then
vely := JS
end if
%Left movement
if chars (KEY_LEFT_ARROW) and whatdotcolour (posx- 15, posy + 24) not= black then
velx :=- 15
end if
%Right movement
if chars (KEY_RIGHT_ARROW) and whatdotcolour (posx + 10, posy + 24) not= black then
velx := 15
else
velx := 0
end if
if whatdotcolor(posx + 20, posy + 60) = yellow then%Player loses health when touched by yellow
HP- = damage
end if
end Movement
|
Mod Edit:
Please wrap all turing code in:
code: | [syntax="turing"] ... code ... [/syntax] |
So that we get proper whitespace and colorized syntax. |
|
|
|
|
|
Tony
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 1:43 pm Post subject: Re: I need some guidance |
|
|
When I run the program it says that it is executing but a few seconds after it says the program is finished being ran and no screen pops up |
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 2:24 pm Post subject: RE:I need some guidance |
|
|
bump |
|
|
|
|
|
Zren
|
Posted: Thu Jun 21, 2012 2:26 pm Post subject: RE:I need some guidance |
|
|
At what point do you actually draw anything? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 2:31 pm Post subject: Re: RE:I need some guidance |
|
|
Zren @ Thu Jun 21, 2012 2:26 pm wrote: At what point do you actually draw anything?
I am new with the turing language, if you have spotted something that is causing my program not to open up and have visible graphics, can you please tell me what it is.
This is a basic project for my grade 10 programming class. |
|
|
|
|
|
Dreadnought
|
Posted: Thu Jun 21, 2012 2:55 pm Post subject: Re: I need some guidance |
|
|
Brandon FS wrote:
if you have spotted something that is causing my program not to open up and have visible graphics, can you please tell me what it is.
It's quite the opposite, we can't spot anything that would make your program create any visible output.
Which part(s) of your program do you think should be drawing things to the screen? |
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 3:07 pm Post subject: Re: I need some guidance |
|
|
Dreadnought @ Thu Jun 21, 2012 2:55 pm wrote: Brandon FS wrote:
if you have spotted something that is causing my program not to open up and have visible graphics, can you please tell me what it is.
It's quite the opposite, we can't spot anything that would make your program create any visible output.
Which part(s) of your program do you think should be drawing things to the screen?
Is there anyway you could tell me the command or commands to give my program visible output.
If you could I would appreciate it, like i said im in grade 10 and this is my first graphics programming assignment |
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 3:33 pm Post subject: Re: I need some guidance |
|
|
I would edit the title of the post but people have already commented on the post |
|
|
|
|
|
Tony
|
Posted: Thu Jun 21, 2012 3:39 pm Post subject: RE:I need some guidance |
|
|
Don't do offscreenonly for now -- that buffers all the output until you call View.Update |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 3:46 pm Post subject: Re: RE:I need some guidance |
|
|
Tony @ Thu Jun 21, 2012 3:39 pm wrote: Don't do offscreenonly for now -- that buffers all the output until you call View.Update
whenever I run my program it says that it is executing and a few seconds after it says execution finished. Every time I run the program no window appears and the game is unplayable.
Thank you for the help so far Tony |
|
|
|
|
|
Brandon FS
|
Posted: Thu Jun 21, 2012 3:47 pm Post subject: Re: RE:I need some guidance |
|
|
Brandon FS @ Thu Jun 21, 2012 3:46 pm wrote: Tony @ Thu Jun 21, 2012 3:39 pm wrote: Don't do offscreenonly for now -- that buffers all the output until you call View.Update
whenever I run my program it says that it is executing and a few seconds after it says execution finished. Every time I run the program no window appears and the game is unplayable.
Thank you for the help so far Tony
I do not mean that in a reluctant way, I am being sincere when I say thank you |
|
|
|
|
|
|